Submission #870816

#TimeUsernameProblemLanguageResultExecution timeMemory
870816mertozelMagnus (COCI18_magnus)C++11
30 / 50
3 ms604 KiB
#include <bits/stdc++.h> using namespace std; using ll = long long; int main(){ string str; cin >> str; int n = str.size(); int cnt = 0; int flag = 1; for(int i = 0; i<n; i++) { if(str[i] == 'H') { i++; while(str[i] != 'O' && i < n) i++; i++; while(str[i] != 'N' && i < n) i++; i++; while(str[i] != 'I' && i < n) i++; if(i == n) break; cnt++; continue; } } cout << cnt << "\n"; return 0; }

Compilation message (stderr)

magnus.cpp: In function 'int main()':
magnus.cpp:13:6: warning: unused variable 'flag' [-Wunused-variable]
   13 |  int flag = 1;
      |      ^~~~
#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...