답안 #776606

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
776606 2023-07-08T05:40:49 Z vjudge1 Magnus (COCI18_magnus) C++17
50 / 50
1 ms 596 KB
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define OYY 1000000000005
#define faster ios_base::sync_with_stdio(false); cin.tie(NULL);
#define mid (start+end)/2
#define mod 1000000007
vector <char> ger;

int32_t main(){
    faster
    string s;
    cin>>s;
    int n=s.length();
    for(int i=0;i<n;i++){
       // if(s[i]=='H ' || s[i]=='O' || s[i]=='N' || s[i]=='I'){
            ger.push_back(s[i]);
        //}
    }
    int cev=0,ans=0;
    for(int i=0;i<ger.size();i++){
        if(cev==0){
            if(ger[i]=='H'){
                cev++;
            }
        }
        else if(cev==1){
            if(ger[i]=='O'){
                cev++;
            }
        }
        else if(cev==2){
            if(ger[i]=='N'){
                cev++;
            }
        }
        else if(cev==3){
            if(ger[i]=='I'){
                cev++;
            }
        }
        if(cev==4){
            cev=0;
            ans++;
        }

    }
    cout<<ans<<'\n';
    return 0;
}

Compilation message

magnus.cpp: In function 'int32_t main()':
magnus.cpp:21:18: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   21 |     for(int i=0;i<ger.size();i++){
      |                 ~^~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 596 KB Output is correct
2 Correct 1 ms 596 KB Output is correct
3 Correct 1 ms 596 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 596 KB Output is correct
2 Correct 1 ms 596 KB Output is correct
3 Correct 1 ms 596 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 596 KB Output is correct
2 Correct 1 ms 596 KB Output is correct
3 Correct 1 ms 596 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 596 KB Output is correct
2 Correct 1 ms 596 KB Output is correct
3 Correct 1 ms 596 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 596 KB Output is correct
2 Correct 1 ms 596 KB Output is correct
3 Correct 1 ms 596 KB Output is correct