Submission #342552

#TimeUsernameProblemLanguageResultExecution timeMemory
342552HazemMagnus (COCI18_magnus)C++14
50 / 50
4 ms620 KiB
/* ID: tmhazem1 LANG: C++14 TASK: pprime */ #include <bits/stdc++.h> using namespace std; #define S second #define F first #define LL long long const int N = 2e5+10; LL LINF = 100000000000000000; LL INF = 1000000000; int MOD = 1e9+7; int main() { // freopen("out.txt","w",stdout); string s,r = "HONI"; cin>>s; int cur = 0,ans = 0; for(int i=0;i<s.size();i++){ if(s[i]==r[cur])cur++; if(cur==4)cur = 0,ans++; } printf("%d\n",ans); }

Compilation message (stderr)

magnus.cpp: In function 'int main()':
magnus.cpp:29:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   29 |     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...