Solutions Arena
882 subscribers
75 photos
5 videos
1 file
34 links
Download Telegram
Goldman Sachs solutions will be uploaded there
Guys next week codechef and codeforces contests denge
👍3🤗1
Thank you for being with me .

With heavy heart im leaving ❤️ .
4👍2
Fielding set 🙂‍↔️
WORLD CHAMPION of the 2025 ICPC World Finals Baku #icpcbaku
St. Petersburg State University
Problems Solved: 11
Northern Eurasia Regional Champion
First to solve Problem B - Blackboard Game
Have lost access to above channel !
♟️ Binary Search
♟️ Two pointers
♟️ Sliding Window
♟️ Merge sort(Divide & Conquire)
♟️BFS & DFS
♟️ Number Theory
♟️ C++ STL


Master this topic to gain a good rank in online judge.
Great opportunity to prepare for the ICPC competitions!

2025-2026 ICPC, NERC, Northern Eurasia Finals (Unrated, Online Mirror, ICPC Rules, Teams Preferred) will take place on the 17th of  December at 08:05 UTC.

Please, join by the link https://codeforces.com/contests/2181
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cassert>

using namespace std;

void solve() {
    string r;
    cin >> r;
    int n = r.length();

    for (char c : r) {
        assert(c == 's' || c == 'u');
    }

    long long dp0 = (r[0] == 'u');
    long long dp1 = 1e18;

    for (int i = 1; i < n; i++) {
        long long new_dp0, new_dp1;

        int cost_to_make_s = (r[i] == 'u');
        new_dp0 = min(dp0, dp1) + cost_to_make_s;

        if (r[i] == 's') {
            new_dp1 = 1e18;
        } else {
            new_dp1 = dp0;
        }

        dp0 = new_dp0;
        dp1 = new_dp1;
    }

    cout << dp0 << "\n";
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    int t;
    cin >> t;
    while (t--) {
        solve();
    }
    return 0;
}
            

Good Bye 2025 (B)
👑 Trade Gold Like a Pro, click here 👑
You don't know anything about trading ? You want to be profitable ? You want to make money while learning ?
Join now and master every move: Tania Trading Academy 👑 🌟

#ad InsideAds