Submission #799468

#TimeUsernameProblemLanguageResultExecution timeMemory
799468Trisanu_DasMagnus (COCI18_magnus)C++17
50 / 50
4 ms596 KiB
#include <bits/stdc++.h> using namespace std; int main() { string s ,f = "HONI"; cin >> s; int idx = 0; for(int i = 0; i < s.size(); i++) if(f[idx % 4] == s[i]) idx++; cout << idx / 4 << '\n'; }

Compilation message (stderr)

magnus.cpp: In function 'int main()':
magnus.cpp:8:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    8 |     for(int i = 0; i < s.size(); i++) if(f[idx % 4] == s[i]) idx++;
      |                    ~~^~~~~~~~~~
#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...