Submission #385838

#TimeUsernameProblemLanguageResultExecution timeMemory
385838AdiZer0Magnus (COCI18_magnus)C++17
50 / 50
4 ms748 KiB
#include <bits/stdc++.h> #define pb push_back #define whole(x) x.begin(), x.end() #define sz(x) (int)x.size() using namespace std; typedef long long ll; typedef long double ld; const int N = (int)1e5 + 7; const int INF = (int)1e9 + 7; const ll linf = (ll)1e18 + 1; int main() { string s; cin >> s; char last = '#'; int ans = 0; for (int i = 0; i < sz(s); ++i) { if (last == '#' && s[i] == 'H') last = 'H'; else { if (last == 'H' && s[i] == 'O') last = 'O'; else if (last == 'O' && s[i] == 'N') last = 'N'; else if (last == 'N' && s[i] == 'I') { last = '#'; ++ans; } } } cout << ans << "\n"; return 0; }
#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...