QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#225187#5501. Ctrl+C Ctrl+VGawor270WA 20ms3608kbC++14874b2023-10-24 04:37:412023-10-24 04:37:41

Judging History

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

  • [2023-10-24 04:37:41]
  • 评测
  • 测评结果:WA
  • 用时:20ms
  • 内存:3608kb
  • [2023-10-24 04:37:41]
  • 提交

answer

#include <bits/stdc++.h>

using namespace std;

#define debug(x) cout << "[" <<  #x << " " << x << "] ";

#define ar array
#define ll long long
#define ld long double
#define sz(x) ((int)x.size())
#define all(a) (a).begin(), (a).end()

typedef vector<int> vi;
typedef pair<int,int> pi;

const int MAX_N = 1e5 + 5;
const ll MOD = 1e9 + 7;
const ll INF = 1e9;
const ld EPS = 1e-9;

void solve() {
    string s;
    cin >> s;
    int n = s.size();
    int count = 0;
    for(int i=0; i<n-4; i++){
        if(s.substr(i,4) == "ania"){
            count++;
            i += 4;
        }
    }
    cout << count << "\n";
}


int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    int tc = 1;
    cin >> tc;
    for (int t = 1; t <= tc; t++) {
        // cout << "Case #" << t << ": ";
        solve();
    }
}

詳細信息

Test #1:

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

input:

3
aniasieurodzilaapotemnicsieniedzialo
nicciekawegouanianiagnieszkianialicji
jeszczekrotszaautobiografiaani

output:

1
2
0

result:

ok 3 lines

Test #2:

score: -100
Wrong Answer
time: 20ms
memory: 3608kb

input:

10000
aniaanianianianiaviananibnianianianianianiapianianianianianianiaanianianianiananianianianiananifw
ananiacnganiaaywbwrkaniahaniaganiaglljaniaouaqrdyaniaypvsgjltrbcvjssrtnehqfzpfvaniahwaniauzncovwfmiqejteiuaniacblxyfikauptesitsitvananianiajndy
anianianianianianiaanianianianianiaanianianianianiaa...

output:

13
11
50
16
10
13
34
2
38
6
18
14
47
6
75
33
56
58
21
12
20
18
16
9
73
3
19
14
43
63
18
24
12
4
25
37
9
64
12
26
50
21
3
12
23
67
5
19
30
21
22
13
28
2
21
2
17
21
65
45
19
9
4
5
19
19
74
1
58
53
8
19
50
12
6
16
66
17
22
18
17
4
71
16
23
8
19
75
10
27
69
8
44
19
22
20
15
51
60
14
2
9
10
5
30
72
0
29
...

result:

wrong answer 3rd lines differ - expected: '53', found: '50'