Submission #96285

#TimeUsernameProblemLanguageResultExecution timeMemory
96285dalgerokMagnus (COCI18_magnus)C++14
50 / 50
3 ms680 KiB
#include<bits/stdc++.h> using namespace std; const char a[] = {'H', 'O', 'N', 'I'}; int main(){ ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0); string s; cin >> s; int ans = 0; for(int i = 0, j = 0; i < (int)s.size(); i++){ if(s[i] == a[j]){ j += 1; if(j == 4){ ans += 1; j = 0; } } } cout << ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...