QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#695591 | #5501. Ctrl+C Ctrl+V | OOBMABTRAMS# | WA | 15ms | 28444kb | C++14 | 532b | 2024-10-31 20:22:32 | 2024-10-31 20:22:34 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int inf=1e9+7;
const int N=1000013;
int a[N];
vector<int>o[N];
int nx[N],pr[N];
int ans[N];
int ad[N];
void solve(){
string s;
cin>>s;
int p=0,ct=0;
string o="ani";
int ans=0;
for(auto c:s) {
if(o[p]==c)ct++,(++p)%=3;
else ans+=(ct+2)/6,ct=0,p=0;
}
ans+=(ct+2)/6;
cout<<ans<<'\n';
}
int main(){
ios::sync_with_stdio(false);
int T=1;
cin>>T;
while(T--)solve();
}
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 28356kb
input:
3 aniasieurodzilaapotemnicsieniedzialo nicciekawegouanianiagnieszkianialicji jeszczekrotszaautobiografiaani
output:
1 2 0
result:
ok 3 lines
Test #2:
score: -100
Wrong Answer
time: 15ms
memory: 28444kb
input:
10000 aniaanianianianiaviananibnianianianianianiapianianianianianianiaanianianianiananianianianiananifw ananiacnganiaaywbwrkaniahaniaganiaglljaniaouaqrdyaniaypvsgjltrbcvjssrtnehqfzpfvaniahwaniauzncovwfmiqejteiuaniacblxyfikauptesitsitvananianiajndy anianianianianianiaanianianianianiaanianianianianiaa...
output:
13 10 42 16 4 11 27 1 21 3 12 12 44 6 67 29 49 55 14 10 17 14 11 6 59 3 15 10 41 58 11 19 7 3 18 25 8 59 11 24 48 16 3 9 21 58 3 17 25 17 18 11 24 1 20 1 16 11 60 40 16 7 2 5 18 16 68 1 56 48 5 12 44 8 5 13 60 14 13 11 11 4 61 15 22 8 15 66 7 22 59 8 39 14 18 18 8 47 49 11 1 8 7 4 25 62 0 25 10 13 3...
result:
wrong answer 2nd lines differ - expected: '11', found: '10'