QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#235934 | #5501. Ctrl+C Ctrl+V | froxyy | RE | 1ms | 3400kb | C++20 | 1.3kb | 2023-11-03 13:33:51 | 2023-11-03 13:33:52 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define FOR(i, l, r) for(int i = (l); i <= (r); ++i)
#define REP(i, n) FOR(i, 0, (n) - 1)
#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define all(x) x.begin(), x.end()
#define sz(x) (int)(x).size()
#define ssize(x) int(x.size())
#define pb push_back
#define fi first
#define se second
#define ld long double
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef pair<ld, ld> pd;
using LL=long long;
#ifdef DEBUG
auto &operator<<(auto &o, pair<auto, auto> p) {
return o << "()" << p.first << ", " << p.second <<")";
}
auto operator<<(auto &o, auto x)-> decltype(x.end(), o) {
o << "{";int i = 0;
for(auto e : x) o << ", "+!i++<<e;
return o <<"}";
}
#define debug(x...) cerr << "["#x"]: ",[](auto...$){((cerr<<$<<"; "),...)<<endl;}(x)
#else
#define debug(...) {}
#endif
void solve() {
string s;
cin >> s;
ll ile = 0;
for (int i = 0; i < s.size()-3; i++) {
if (s[i] == 'a' && s[i+1] == 'n' && s[i+2] == 'i'
&& s[i+3] == 'a') {
ile++;
i = i + 3;
}
}
cout << ile << '\n';
}
int main() {
cin.tie(0)->sync_with_stdio(0);
int z;
cin >> z;
while(z--) {
solve();
}
}
詳細信息
Test #1:
score: 100
Accepted
time: 1ms
memory: 3400kb
input:
3 aniasieurodzilaapotemnicsieniedzialo nicciekawegouanianiagnieszkianialicji jeszczekrotszaautobiografiaani
output:
1 2 0
result:
ok 3 lines
Test #2:
score: -100
Runtime Error
input:
10000 aniaanianianianiaviananibnianianianianianiapianianianianianianiaanianianianiananianianianiananifw ananiacnganiaaywbwrkaniahaniaganiaglljaniaouaqrdyaniaypvsgjltrbcvjssrtnehqfzpfvaniahwaniauzncovwfmiqejteiuaniacblxyfikauptesitsitvananianiajndy anianianianianianiaanianianianianiaanianianianianiaa...