답안 #1074762

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1074762 2024-08-25T13:49:45 Z vjudge1 Magnus (COCI18_magnus) C++17
50 / 50
4 ms 740 KB
#include <bits/stdc++.h>
using namespace std;
int main()
{
    string s, aux="HONI";
    cin>>s;
    int j=0,cont=0;
    for(int i=0;i<s.size();i++){
        if(aux[j]==s[i]){
            j++;
            if(j==4){
                cont++;
                j=0;
            }
        }
    }
    cout<<cont<<"\n";

    return 0;
}

Compilation message

magnus.cpp: In function 'int main()':
magnus.cpp:8:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    8 |     for(int i=0;i<s.size();i++){
      |                 ~^~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 604 KB Output is correct
2 Correct 3 ms 652 KB Output is correct
3 Correct 4 ms 604 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 604 KB Output is correct
2 Correct 2 ms 732 KB Output is correct
3 Correct 2 ms 604 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 604 KB Output is correct
2 Correct 2 ms 604 KB Output is correct
3 Correct 4 ms 604 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 604 KB Output is correct
2 Correct 2 ms 740 KB Output is correct
3 Correct 2 ms 604 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 604 KB Output is correct
2 Correct 2 ms 604 KB Output is correct
3 Correct 4 ms 632 KB Output is correct