답안 #165365

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
165365 2019-11-26T15:11:04 Z itiam Magnus (COCI18_magnus) C++11
50 / 50
10 ms 760 KB
#include <iostream>
#include <string>

using namespace std;

int main(){
    char L[100000],L2[4]={'H','O','N','I'},s;
    string x;
    int c=0,j=0,br=0;
    cin >> x;
    for (int i=0; i<x.length();i++){
        s=x[i];
        //cout << "\n" << x << "\n";
        L[i]=s;
        if (L[i]==L2[j]){
            j+=1;
        }
        if (j==4){
            j=0;
            br+=1;
        }
    }
    cout << br;
    return 0;
}

Compilation message

magnus.cpp: In function 'int main()':
magnus.cpp:11:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for (int i=0; i<x.length();i++){
                   ~^~~~~~~~~~~
magnus.cpp:9:9: warning: unused variable 'c' [-Wunused-variable]
     int c=0,j=0,br=0;
         ^
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 2 ms 252 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 256 KB Output is correct
3 Correct 2 ms 256 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 256 KB Output is correct
2 Correct 2 ms 256 KB Output is correct
3 Correct 9 ms 256 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 256 KB Output is correct
2 Correct 2 ms 256 KB Output is correct
3 Correct 2 ms 384 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 256 KB Output is correct
2 Correct 2 ms 256 KB Output is correct
3 Correct 2 ms 376 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 8 ms 632 KB Output is correct
2 Correct 10 ms 632 KB Output is correct
3 Correct 8 ms 632 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 8 ms 632 KB Output is correct
2 Correct 8 ms 632 KB Output is correct
3 Correct 9 ms 760 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 8 ms 632 KB Output is correct
2 Correct 8 ms 632 KB Output is correct
3 Correct 8 ms 632 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 8 ms 632 KB Output is correct
2 Correct 8 ms 632 KB Output is correct
3 Correct 8 ms 632 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 10 ms 632 KB Output is correct
2 Correct 9 ms 632 KB Output is correct
3 Correct 9 ms 632 KB Output is correct