Submission #146089

#TimeUsernameProblemLanguageResultExecution timeMemory
146089youssan_williamMagnus (COCI18_magnus)C++14
50 / 50
9 ms632 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { string s; cin >> s; string target= "HONI"; int c=0,ans=0; for(int i = 0 ; i < s.size() ;i++) { if(s[i]==target[c]) { c++; } if(c==4) { ans++; c=0; } } cout << ans; return 0; }

Compilation message (stderr)

magnus.cpp: In function 'int main()':
magnus.cpp:11:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(int i = 0 ; i < s.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...