Submission #165365

#TimeUsernameProblemLanguageResultExecution timeMemory
165365itiamMagnus (COCI18_magnus)C++11
50 / 50
10 ms760 KiB
#include <iostream> #include <string> using namespace std; int main(){ char L[100000],L2[4]={'H','O','N','I'},s; string x; int c=0,j=0,br=0; cin >> x; for (int i=0; i<x.length();i++){ s=x[i]; //cout << "\n" << x << "\n"; L[i]=s; if (L[i]==L2[j]){ j+=1; } if (j==4){ j=0; br+=1; } } cout << br; return 0; }

Compilation message (stderr)

magnus.cpp: In function 'int main()':
magnus.cpp:11:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for (int i=0; i<x.length();i++){
                   ~^~~~~~~~~~~
magnus.cpp:9:9: warning: unused variable 'c' [-Wunused-variable]
     int c=0,j=0,br=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...