QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#105249 | #5501. Ctrl+C Ctrl+V | pdstiago# | WA | 26ms | 3432kb | C++14 | 620b | 2023-05-13 19:43:57 | 2023-05-13 19:44:01 |
Judging History
answer
#include "bits/stdc++.h"
using namespace std;
#define mxn 1e5+5
#define fastio ios_base::sync_with_stdio(false), cin.tie(nullptr)
#define endl '\n'
typedef long long ll;
int solve(){
string s;
cin >> s;
int cont=0;
int last=-1;
for(int i=0; i<=(int)s.size()-4; i++){
string a = s.substr(i, 4);
if(a=="ania"){
if(last!=i) cont++;
last = i+3;
}
}
cout << cont << endl;
return 0;
}
int main(){
fastio;
int t = 1;
cin >> t;
while(t--){
solve();
}
return 0;
}
详细
Test #1:
score: 100
Accepted
time: 2ms
memory: 3380kb
input:
3 aniasieurodzilaapotemnicsieniedzialo nicciekawegouanianiagnieszkianialicji jeszczekrotszaautobiografiaani
output:
1 2 0
result:
ok 3 lines
Test #2:
score: -100
Wrong Answer
time: 26ms
memory: 3432kb
input:
10000 aniaanianianianiaviananibnianianianianianiapianianianianianianiaanianianianiananianianianiananifw ananiacnganiaaywbwrkaniahaniaganiaglljaniaouaqrdyaniaypvsgjltrbcvjssrtnehqfzpfvaniahwaniauzncovwfmiqejteiuaniacblxyfikauptesitsitvananianiajndy anianianianianianiaanianianianianiaanianianianianiaa...
output:
6 11 21 4 9 6 35 2 38 7 18 3 24 2 28 16 20 28 21 13 22 18 18 9 26 3 19 14 22 21 17 25 14 4 27 37 9 18 13 16 25 23 3 13 7 25 5 9 31 22 22 13 17 2 12 2 18 21 35 19 20 9 5 6 12 22 27 1 28 22 8 19 17 13 6 6 26 18 22 19 19 4 32 17 25 4 19 30 10 28 25 4 20 21 12 12 15 21 26 14 2 4 10 5 32 27 0 29 13 27 36...
result:
wrong answer 1st lines differ - expected: '13', found: '6'