QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#76933#5501. Ctrl+C Ctrl+VCrazyMurky#RE 2ms3444kbC++20441b2023-02-12 18:20:012023-02-12 18:20:06

Judging History

你现在查看的是最新测评结果

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-02-12 18:20:06]
  • 评测
  • 测评结果:RE
  • 用时:2ms
  • 内存:3444kb
  • [2023-02-12 18:20:01]
  • 提交

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();
}

Details

Tip: Click on the bar to expand more detailed information

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...

output:


result: