QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#154603 | #5501. Ctrl+C Ctrl+V | berarchegas# | WA | 8ms | 3664kb | C++17 | 840b | 2023-08-31 19:31:37 | 2023-08-31 19:31:37 |
Judging History
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'