QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#76933 | #5501. Ctrl+C Ctrl+V | CrazyMurky# | RE | 2ms | 3444kb | C++20 | 441b | 2023-02-12 18:20:01 | 2023-02-12 18:20:06 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
void solve() {
string s; cin >> s;
int ans = 0;
for (int i = 0; i < s.size() - 4; ++i) {
if (s.substr(i, 4) == "ania") {
s[i + 3] = 'x';
ans++;
}
}
cout << ans << '\n';
}
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int t = 1; cin >> t;
while (t--) solve();
}
詳細信息
Test #1:
score: 100
Accepted
time: 2ms
memory: 3444kb
input:
3 aniasieurodzilaapotemnicsieniedzialo nicciekawegouanianiagnieszkianialicji jeszczekrotszaautobiografiaani
output:
1 2 0
result:
ok 3 lines
Test #2:
score: -100
Dangerous Syscalls
input:
10000 aniaanianianianiaviananibnianianianianianiapianianianianianianiaanianianianiananianianianiananifw ananiacnganiaaywbwrkaniahaniaganiaglljaniaouaqrdyaniaypvsgjltrbcvjssrtnehqfzpfvaniahwaniauzncovwfmiqejteiuaniacblxyfikauptesitsitvananianiajndy anianianianianianiaanianianianianiaanianianianianiaa...