QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#105249#5501. Ctrl+C Ctrl+Vpdstiago#WA 26ms3432kbC++14620b2023-05-13 19:43:572023-05-13 19:44:01

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:44:01]
  • 评测
  • 测评结果:WA
  • 用时:26ms
  • 内存:3432kb
  • [2023-05-13 19:43:57]
  • 提交

answer

#include "bits/stdc++.h"

using namespace std;

#define mxn 1e5+5
#define fastio ios_base::sync_with_stdio(false), cin.tie(nullptr)
#define endl '\n'
typedef long long ll;


int solve(){
    string s;
    cin >> s;

    int cont=0;

    int last=-1;

    for(int i=0; i<=(int)s.size()-4; i++){
        string a = s.substr(i, 4);
        if(a=="ania"){
            if(last!=i) cont++;
            last = i+3;
        }
    }

    cout << cont << endl;
    return 0;
}

int main(){
    fastio;

    int t = 1; 
    cin >> t;

    while(t--){
        solve();
    }

    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 2ms
memory: 3380kb

input:

3
aniasieurodzilaapotemnicsieniedzialo
nicciekawegouanianiagnieszkianialicji
jeszczekrotszaautobiografiaani

output:

1
2
0

result:

ok 3 lines

Test #2:

score: -100
Wrong Answer
time: 26ms
memory: 3432kb

input:

10000
aniaanianianianiaviananibnianianianianianiapianianianianianianiaanianianianiananianianianiananifw
ananiacnganiaaywbwrkaniahaniaganiaglljaniaouaqrdyaniaypvsgjltrbcvjssrtnehqfzpfvaniahwaniauzncovwfmiqejteiuaniacblxyfikauptesitsitvananianiajndy
anianianianianianiaanianianianianiaanianianianianiaa...

output:

6
11
21
4
9
6
35
2
38
7
18
3
24
2
28
16
20
28
21
13
22
18
18
9
26
3
19
14
22
21
17
25
14
4
27
37
9
18
13
16
25
23
3
13
7
25
5
9
31
22
22
13
17
2
12
2
18
21
35
19
20
9
5
6
12
22
27
1
28
22
8
19
17
13
6
6
26
18
22
19
19
4
32
17
25
4
19
30
10
28
25
4
20
21
12
12
15
21
26
14
2
4
10
5
32
27
0
29
13
27
36...

result:

wrong answer 1st lines differ - expected: '13', found: '6'