QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#185830 | #5501. Ctrl+C Ctrl+V | marta | RE | 0ms | 3572kb | C++14 | 449b | 2023-09-22 17:20:41 | 2023-09-22 17:20:41 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
int t, ile;
string s;
void solve()
{
ile=0;
cin>>s;
for(int i=0; i<s.size()-3; i++) {
if(s[i]=='a' and s[i+1]=='n' and s[i+2]=='i' and s[i+3]=='a')
{
ile++;
i+=3;
}
}
cout<<ile<<'\n';
}
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
cin>>t;
while(t--) solve();
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3572kb
input:
3 aniasieurodzilaapotemnicsieniedzialo nicciekawegouanianiagnieszkianialicji jeszczekrotszaautobiografiaani
output:
1 2 0
result:
ok 3 lines
Test #2:
score: -100
Runtime Error
input:
10000 aniaanianianianiaviananibnianianianianianiapianianianianianianiaanianianianiananianianianiananifw ananiacnganiaaywbwrkaniahaniaganiaglljaniaouaqrdyaniaypvsgjltrbcvjssrtnehqfzpfvaniahwaniauzncovwfmiqejteiuaniacblxyfikauptesitsitvananianiajndy anianianianianianiaanianianianianiaanianianianianiaa...