QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#154603#5501. Ctrl+C Ctrl+Vberarchegas#WA 8ms3664kbC++17840b2023-08-31 19:31:372023-08-31 19:31:37

Judging History

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

  • [2023-08-31 19:31:37]
  • 评测
  • 测评结果:WA
  • 用时:8ms
  • 内存:3664kb
  • [2023-08-31 19:31:37]
  • 提交

answer

#include <bits/stdc++.h>
 
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
 
mt19937 rng((int) chrono::steady_clock::now().time_since_epoch().count());
    
const int MOD = 1e9 + 7;
const int MAXN = 2e5 + 5;
const ll INF = 2e18;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);

    int t;
    cin >> t;

    string pat = "ania";

    while( t-- )
    {
        string s;
        cin >> s;

        int ans = 0, p = 0;

        for(int i = 0 ; i < (int)s.size() ; i++)
        {
            if( s[i] == pat[p] )
            {
                p++;

                if( p == 4 )
                    ans++, p = 0;
            }
            else
                p = 0;
        }

        cout << ans << "\n";
    }
    
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

3
aniasieurodzilaapotemnicsieniedzialo
nicciekawegouanianiagnieszkianialicji
jeszczekrotszaautobiografiaani

output:

1
2
0

result:

ok 3 lines

Test #2:

score: -100
Wrong Answer
time: 8ms
memory: 3664kb

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'