#include <bits/stdc++.h>
using namespace std;
const int DIM = 1e5 + 5;
int N, pos, nrc;
char aux[4] = { 'H', 'O', 'N', 'I' };
char arr[DIM];
int main(){
cin >> arr;
N = strlen( arr );
for( int i = 0; i < N; i++ ){
if( arr[i] == aux[pos] )
pos++;
if( pos == 4 )
nrc++, pos = 0;
}
cout << nrc;
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
376 KB |
Output is correct |
2 |
Correct |
2 ms |
252 KB |
Output is correct |
3 |
Correct |
2 ms |
376 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
424 KB |
Output is correct |
2 |
Correct |
2 ms |
256 KB |
Output is correct |
3 |
Correct |
2 ms |
256 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
376 KB |
Output is correct |
2 |
Correct |
2 ms |
376 KB |
Output is correct |
3 |
Correct |
2 ms |
252 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
256 KB |
Output is correct |
2 |
Correct |
2 ms |
256 KB |
Output is correct |
3 |
Correct |
2 ms |
376 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
356 KB |
Output is correct |
2 |
Correct |
2 ms |
504 KB |
Output is correct |
3 |
Correct |
2 ms |
376 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
8 ms |
552 KB |
Output is correct |
2 |
Correct |
8 ms |
500 KB |
Output is correct |
3 |
Correct |
8 ms |
504 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
9 ms |
632 KB |
Output is correct |
2 |
Correct |
8 ms |
540 KB |
Output is correct |
3 |
Correct |
8 ms |
504 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
8 ms |
504 KB |
Output is correct |
2 |
Correct |
8 ms |
504 KB |
Output is correct |
3 |
Correct |
8 ms |
504 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
9 ms |
504 KB |
Output is correct |
2 |
Correct |
8 ms |
480 KB |
Output is correct |
3 |
Correct |
8 ms |
504 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
8 ms |
496 KB |
Output is correct |
2 |
Correct |
8 ms |
504 KB |
Output is correct |
3 |
Correct |
8 ms |
504 KB |
Output is correct |