Submission #120789

#TimeUsernameProblemLanguageResultExecution timeMemory
120789cveleMagnus (COCI18_magnus)C++14
50 / 50
11 ms676 KiB
#include <iostream> #include <sstream> #include <cstdio> #include <cstdlib> #include <cmath> #include <cctype> #include <cstring> #include <iomanip> #include <bitset> #include <algorithm> #include <vector> #include <stack> #include <queue> #include <deque> #include <set> #include <list> #include <map> using namespace std; int main() { string a; cin >> a; int lst = '0'; int ans = 0; for (int i = 0; i < a.size(); i++) { if (a[i] == 'H' && lst == '0') { lst = 'H'; } else if (a[i] == 'O' && lst == 'H') { lst = 'O'; } else if (a[i] == 'N' && lst == 'O') { lst = 'N'; } else if (a[i] == 'I' && lst == 'N') { lst = '0'; ans++; } } cout << ans << endl; return 0; }

Compilation message (stderr)

magnus.cpp: In function 'int main()':
magnus.cpp:26:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for (int i = 0; i < a.size(); i++) {
                   ~~^~~~~~~~~~
#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...