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
St. Petersburg State University
Problems Solved: 11
Northern Eurasia Regional Champion
First to solve Problem B - Blackboard Game
♟️ 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.
♟️ 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
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
Codeforces
2025-2026 ICPC, NERC, Northern Eurasia Finals (Unrated, Online Mirror, ICPC Rules, Teams Preferred) - Codeforces
Codeforces. Programming competitions and contests, programming community
#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)
#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)