This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
#define ll long long
#define f first
#define sc second
#define pb push_back
using namespace std;
ll c,d,i,e,f,g,n,m,k,l,A[1000005],B[1000005],maxx,idx,ans,cnt;
ll wyvili,rad,sz,t;
ll a,b;
string s;
int main() {
ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);
cin>>s;
for(ll i=0;i<s.size();i++) {
if(a%4==0) {
if(s[i]=='H') a++;
} else if(a%4==1) {
if(s[i]=='O') a++;
} else if(a%4==2) {
if(s[i]=='N') a++;
} else if(a%4==3) {
if(s[i]=='I') { ans++; a++; }
}
}
cout<<ans;
}
Compilation message (stderr)
magnus.cpp: In function 'int main()':
magnus.cpp:14:17: 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]
14 | for(ll i=0;i<s.size();i++) {
| ~^~~~~~~~~
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |