# B1 Ohio and skibidus #include <bits/stdc++.h> #include <iostream> #include <stack> #include <string> using namespace std; int main() { int t; cin >> t; while (t--) { string s; cin >> s; int n = s.length(); int m = 0; for (int i = 0; i < n - 1; ++ i) { if (s[i] == s[i + 1]) { m ++; i ++; } } cout << n - m << endl; } return 0; } --- # B2 A+B? #include <bits/stdc++.h> #include <iostream> #include <stack> #include <string> using namespace std; int main(){ int a; int b; int ab; int t; cin >> t; while (t--) { cout << "add the first number: "; cin >> a; cout << "add the second number: "; cin >> b; if (1 <= a && a < 10 && 1 <= b && b < 10){ cout << "here u r a + b: " << (ab = a + b) << endl; }else{ cout << "NO! fuck you, chill"; } } return 0; } --- # B3 Cloudberry Jam #include <bits/stdc++.h> #include <iostream> #include <stack> #include <string> using namespace std; int main(){ int a; int b; int ab; int t; cin >> t; while (t--) { cout << "add the first number: "; cin >> a; cout << "add the second number: "; cin >> b; if (1 <= a && a < 10 && 1 <= b && b < 10){ cout << "here u r a + b: " << (ab = a + b) << endl; }else{ cout << "NO! fuck you, chill"; } } return 0; } --- # B4 New World New Me New Array #include <iostream> #include <cmath> using namespace std; int main() { int t; cin >> t; while (t--) { int n, k, p; cin >> n >> k >> p; if (abs(k) > n * p) { cout << -1 << endl; } else { int result = (abs(k) + p - 1) / p; cout << result << endl; } } return 0; } --- # B5 A+B Again? #include <bits/stdc++.h> #include <iostream> #include <stack> #include <string> #include <cmath> using namespace std; int main(){ int t; cin >> t; if (1 < t && t < 90){ while (t--) { int number; int tong = 0; cout << "add ur number u want: "; cin >> number; if (1 < number && number < 100){ while (number > 0){ tong += number % 10; number /= 10; } cout << "here u are: " << tong <<'\n'; }else{ cout << "NO only 2 digital numbers, u can continue (REMEMBER THIS) " << '\n'; } } }else{ cout << "warning do not do this again for this programe not be able to load please be careful"; } return 0; } --- # B6 Easy Problem #include <iostream> using namespace std; int main() { int t; cout << "add how much times you want to test: "; cin >> t; if (1 <= t && t <= 99){ while (t--) { int n = 0; cout << endl << "ur number u would like to know (only from 2 to 100 do not out this range): "; cin >> n; int a = 0; int count = 0; if (2 <= n && n <= 100){ for (int b = 1; b < n; b++) { a = n - b; if (a > 0) { count++; cout << "(" << a << "," << b << ")" << endl; } } cout << "here are the couple a,b u need: " << count << " ^-^" << endl; }else if (100 < n){ cout << "bro that too much, why you need that much?" << endl << ". _.?" << endl << "you can continue ^^" << endl; }else{ cout << "bro that too small, I refuse to do this!" << endl << "-_-" << endl << "continue im lazy right now T^T" << endl; } } } return 0; } --- # B7 Mid Problem #include <iostream> #include <algorithm> #include <string> using namespace std; int main() { int t; cout << "how much u want? ^^ : "; cin >> t; cout << endl; while (t--) { string a, b = ""; cout << "ok add ur string now only contain (q, w, p): "; cin >> a; cout << endl; for (char ch : a) { if (ch == 'p') b += 'q'; else if (ch == 'q') b += 'p'; else b += 'w'; } reverse(b.begin(), b.end()); cout << "here bruh why this so stupid...: " << b << endl; cout << endl; } return 0; } //lần này tha cho, ko cs nhiều như lần trc đâu >:/ --- # B8 Is it a cat? #include <iostream> using namespace std; int main() { int n, length, currentcharacter; bool can = true; char meow[4]= {'m','e','o','w'}; cin >> n; while (n--){ cin >> length; currentcharacter = 0; string str; cin >> str; for (int i = 0; i < length; i ++){ if (char(tolower(str.at(i))) != meow[currentcharacter]){ currentcharacter++; if (i == 0|| currentcharacter > 3 || char(tolower(str.at(i))) != meow[currentcharacter]){ cout << "NO"; can = false; break; } } } if (can && currentcharacter == 3) cout << "YES"; else if (can) cout << "NO"; can = true; currentcharacter = 0; if (n == 0) continue; cout << '\n'; } return 0; }