QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#105245 | #5501. Ctrl+C Ctrl+V | pdstiago# | RE | 2ms | 3440kb | C++14 | 615b | 2023-05-13 19:41:16 | 2023-05-13 19:41:18 |
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<=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: 3440kb
input:
3 aniasieurodzilaapotemnicsieniedzialo nicciekawegouanianiagnieszkianialicji jeszczekrotszaautobiografiaani
output:
1 2 0
result:
ok 3 lines
Test #2:
score: -100
Dangerous Syscalls
input:
10000 aniaanianianianiaviananibnianianianianianiapianianianianianianiaanianianianiananianianianiananifw ananiacnganiaaywbwrkaniahaniaganiaglljaniaouaqrdyaniaypvsgjltrbcvjssrtnehqfzpfvaniahwaniauzncovwfmiqejteiuaniacblxyfikauptesitsitvananianiajndy anianianianianianiaanianianianianiaanianianianianiaa...