QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#526253#5501. Ctrl+C Ctrl+VchimeraWA 27ms3580kbC++11559b2024-08-21 12:43:262024-08-21 12:43:28

Judging History

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

  • [2024-08-21 12:43:28]
  • 评测
  • 测评结果:WA
  • 用时:27ms
  • 内存:3580kb
  • [2024-08-21 12:43:26]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

int main() {
    ll T; cin >> T;
    while(T--) {
        string S; cin >> S;
        ll idx = 0;
        string bad = "ania";
        ll cost = 0;

        for(ll i = 0; i < S.size(); i++) {
            if(S[i] == bad[idx]) {
                idx++;
                if(idx == 4) {
                    idx = 0;
                    cost++;
                }
            } else {
                idx = 0;
            }
        }

        cout << cost << '\n';
    }
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3580kb

input:

3
aniasieurodzilaapotemnicsieniedzialo
nicciekawegouanianiagnieszkianialicji
jeszczekrotszaautobiografiaani

output:

1
2
0

result:

ok 3 lines

Test #2:

score: -100
Wrong Answer
time: 27ms
memory: 3528kb

input:

10000
aniaanianianianiaviananibnianianianianianiapianianianianianianiaanianianianiananianianianiananifw
ananiacnganiaaywbwrkaniahaniaganiaglljaniaouaqrdyaniaypvsgjltrbcvjssrtnehqfzpfvaniahwaniauzncovwfmiqejteiuaniacblxyfikauptesitsitvananianiajndy
anianianianianianiaanianianianianiaanianianianianiaa...

output:

13
10
45
16
4
11
27
1
25
5
12
12
43
7
72
32
47
57
13
11
19
14
11
7
67
3
16
9
41
59
11
19
8
3
18
21
8
62
13
26
49
16
3
8
23
64
3
19
27
20
18
11
24
2
22
1
16
12
65
45
18
7
2
6
20
19
70
1
58
50
6
11
45
8
4
18
66
16
14
11
12
4
66
15
24
8
15
76
7
22
63
7
41
15
20
19
8
48
55
11
1
8
7
4
28
71
0
24
10
14
33...

result:

wrong answer 2nd lines differ - expected: '11', found: '10'