# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
91872 | Ort | Magnus (COCI18_magnus) | C++14 | 7 ms | 632 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<iostream>
#include<string>
#include<vector>
using namespace std;
int main() {
cin.sync_with_stdio(0); cin.tie(0);
cin.exceptions(cin.failbit);
string s;
cin >> s;
vector<char> S; int sol = 0;
for(int i=0;i<s.length();i++) {
if(s[i]!='H' && s[i]!='O' && s[i]!='N' && s[i]!='I') continue;
if(s[i]=='H' && S.empty()) S.push_back(s[i]);
if(s[i]=='O' && S.size()==1) S.push_back(s[i]);
if(s[i]=='N' && S.size()==2) S.push_back(s[i]);
if(s[i]=='I' && S.size()==3) S.push_back(s[i]);
if(S.size()==4) {
S.clear(); sol++;
}
}
cout << sol;
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... |