Submission #199795

#TimeUsernameProblemLanguageResultExecution timeMemory
199795pathMagnus (COCI18_magnus)C++14
50 / 50
6 ms632 KiB
#include <bits/stdc++.h> using namespace std; typedef long long int ll; #define f first #define s second #define pb push_back int ans,lst; char c[5]={'H','O','N','I'}; string s; int main(){ cin.tie(NULL); cout.tie(NULL); ios_base::sync_with_stdio(false); cin>>s; for(int i=0;i<s.size();i++){ if(s[i]==c[lst]){ lst++; if(lst==4){ ans++,lst=0; } } } cout<<ans<<'\n'; return 0; }

Compilation message (stderr)

magnus.cpp: In function 'int main()':
magnus.cpp:15:18: 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...