Submission #562117

#TimeUsernameProblemLanguageResultExecution timeMemory
562117AGEMagnus (COCI18_magnus)C++14
50 / 50
5 ms640 KiB
#include<bits/stdc++.h> #define F first #define S second #define pb push_back #define int long long using namespace std; const int N=1e6,M=2e3,mod=1e9+7; main() { string s; cin>>s; int h=0,o=0,n=0,i=0; char last='I'; for(int ii=0;ii<s.size();ii++){ if(s[ii]=='H'&&last=='I') h++,last='H'; if(s[ii]=='O'&&last=='H') o++,last='O'; if(s[ii]=='N'&&last=='O') n++,last='N'; if(s[ii]=='I'&&last=='N') i++,last='I'; } cout<<min({h,o,n,i})<<endl; return 0; }

Compilation message (stderr)

magnus.cpp:9:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    9 | main()
      | ^~~~
magnus.cpp: In function 'int main()':
magnus.cpp:16:20: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   16 |     for(int ii=0;ii<s.size();ii++){
      |                  ~~^~~~~~~~~
#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...