제출 #313185

#제출 시각아이디문제언어결과실행 시간메모리
313185nekiMagnus (COCI18_magnus)C++14
50 / 50
7 ms684 KiB
#include <bits/stdc++.h>
#define loop(i, a, b) for(long long i=a;i<b;i++)
#define pool(i, a, b) for(long long i=a-1;i>=b;i--)
#define fore(i, a) for(auto&& i:a)
#define fi first
#define se second
#define ps(a) push_back(a)
#define pb(a) pop_back(a)
#define sc scanf
#define vc vector
#define pa pair<ll, ll>
#define ll long long
#define lb lower_bound
#define ub upper_bound
#define all(a) a.begin(), a.end()
#define llmax LLONG_MAX/2
#define llmin -LLONG_MAX/2
using namespace std;
#define mn 2600
#define pa pair<ll, ll>
#define ld long double 

int main(){
    string a;cin >> a;
    ll cnt=0, ans=0;
    fore(t, a){
        if(cnt==0){if(t=='H') cnt++;}
        else if(cnt==1){if(t=='O') cnt++;}
        else if(cnt==2){if(t=='N') cnt++;}
        else if(cnt==3){if(t=='I') cnt=0, ans++;}
    }
    cout << ans <<endl;
}
#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...