Submission #645690

#TimeUsernameProblemLanguageResultExecution timeMemory
645690ali72Magnus (COCI18_magnus)C++17
50 / 50
2 ms596 KiB
#include <bits/extc++.h> using namespace std; using namespace __gnu_pbds; #define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> const int N = (2e5) + 7; void ALI_72(){ string s, _s = "HONI"; cin >> s; int cnt = 0; for(int i = 0, it = 0; i < s.size(); ++i){ if(s[i] == _s[it]){ it++; } if(it == 4){ cnt++; it = 0; } } cout << cnt << '\n'; } signed main() { ios_base :: sync_with_stdio(0); cin.tie(0), cout.tie(0); int t = 1; //cin >> t; while(t--){ ALI_72(); } return 0; }

Compilation message (stderr)

magnus.cpp: In function 'void ALI_72()':
magnus.cpp:11:30: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   11 |     for(int i = 0, it = 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...