QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#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();
}
详细
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...