QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#153240 | #6867. String Problem | neko_nyaa | AC ✓ | 6ms | 3744kb | C++23 | 516b | 2023-08-29 19:11:24 | 2023-08-29 19:11:25 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define int long long
const int M = 998244353;
int modpow(int n, int k) {
int ans = 1;
while (k) {
if (k % 2) ans = (ans*n) % M;
n = (n*n) % M; k /= 2;
}
return ans;
}
void solve() {
string s; cin >> s;
int ans = 0;
for (int i = 1; i < s.size(); i++) {
if (s[i] == s[i-1]) ans++;
}
cout << ans << '\n';
}
signed main() {
ios::sync_with_stdio(0); cin.tie(0);
int t; cin >> t;
while (t--) {
solve();
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 6ms
memory: 3744kb
input:
16 abcdefg pqtcuxgggzxwviimecjcewjagmkozprogmrcjzjsagqvozkubvxitikzuxpwogkuudzgfiyfqodgnparkxbdilceisaxantvqsdxcbdspgyfvzyhyzkgkolvinujangtijqkkvfbddiaeghffrnsgapoojzqwhlgsetezygfdofkvnpcgewohlfvuentobzgfslgstlwhrgeexjmbfbirgflmvecwgjdawjtpvrymxfswoezthimnpycmeekmnnnlxgaszzewgyuuctpkdczvcdhgistxfijc...
output:
0 3845 3864 3765 25214 25033 1 1 24911 5041 4981 9999 9999 3829 3872 3856
result:
ok 16 lines