QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#105246#5501. Ctrl+C Ctrl+VTime7#WA 27ms3428kbC++14698b2023-05-13 19:41:402023-05-13 19:41:44

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-05-13 19:41:44]
  • 评测
  • 测评结果:WA
  • 用时:27ms
  • 内存:3428kb
  • [2023-05-13 19:41:40]
  • 提交

answer

#include "bits/stdc++.h"

using namespace std;
using lint = int64_t;

int main() {
    cin.tie(nullptr)->sync_with_stdio(false);
    int z;
    string s, p = "ania";
    cin >> z;
    while(z--) {
        cin >> s;
        int ans = 0;
        for(int i = 0; i < (int) s.size() - 4; i++) {
            bool ok = true;
            for(int j = 0; j < 4; j++) {
                if(s[i+j] != p[j]) ok = false;
                // cout << s[i+j] << " " << p[j] << " " << ok << endl;
            }
            // cout << endl;
            if(ok) {
                s[i+3] = 'z';
                ans++;
            }
        }
        cout << ans << endl;
    }

    return 0;
}

详细

Test #1:

score: 100
Accepted
time: 1ms
memory: 3428kb

input:

3
aniasieurodzilaapotemnicsieniedzialo
nicciekawegouanianiagnieszkianialicji
jeszczekrotszaautobiografiaani

output:

1
2
0

result:

ok 3 lines

Test #2:

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

input:

10000
aniaanianianianiaviananibnianianianianianiapianianianianianianiaanianianianiananianianianiananifw
ananiacnganiaaywbwrkaniahaniaganiaglljaniaouaqrdyaniaypvsgjltrbcvjssrtnehqfzpfvaniahwaniauzncovwfmiqejteiuaniacblxyfikauptesitsitvananianiajndy
anianianianianianiaanianianianianiaanianianianianiaa...

output:

13
11
53
16
10
13
35
2
39
7
19
14
47
7
78
34
59
60
21
13
22
18
18
9
77
3
19
14
44
64
18
26
13
4
27
38
9
65
13
27
51
23
3
13
25
69
5
19
32
23
22
13
29
2
23
2
18
21
68
49
21
9
5
6
21
22
77
1
60
54
8
19
51
13
6
18
70
18
22
19
19
4
74
17
26
8
19
77
11
28
72
8
45
20
23
21
15
54
65
14
2
9
10
5
33
78
0
30
...

result:

wrong answer 33rd lines differ - expected: '14', found: '13'