# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1121335 | qrn | Magnus (COCI18_magnus) | C++14 | 2 ms | 760 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
#define SPEED \
ios_base::sync_with_stdio(0); \
cin.tie(NULL); \
cout.tie(NULL);
#define pb push_back
#define endl "\n"
#define ALL(x) x.begin(), x.end()
#define intt long long
const intt mxN = 2e5 + 5, L = 20, mxA = 5e5 + 35;
char g[4] = {'H', 'O', 'N', 'I'};
void solve () {
string s;
cin >> s;
int ans = 0, ind = 0;
for(int i = 0; i < s.size(); i++) {
if(s[i] == g[ind]) {
ind++;
if(ind == 4) {
ind = 0;
ans++;
}
}
}
cout << ans << endl;
}
int main() {
SPEED;
int tst = 1;
// cin >> tst;
while (tst--) {
solve();
}
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |