답안 #199800

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
199800 2020-02-03T13:04:42 Z Gamma Magnus (COCI18_magnus) C++14
50 / 50
11 ms 504 KB
#include <bits/stdc++.h>

using namespace std;
string s, c = "HONI";
int ans;
int main()
{
    cin >> s;
    int j = 0;
    for(int i = 0; i < s.size(); i++)
    {
        if(c[j] == s[i])
        {
            if(c[j] == 'I') ans++;
            
            j++;
            j %= 4;
        }
    }
    printf("%d\n", ans);
}

Compilation message

magnus.cpp: In function 'int main()':
magnus.cpp:10:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(int i = 0; i < s.size(); i++)
                    ~~^~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 256 KB Output is correct
2 Correct 5 ms 256 KB Output is correct
3 Correct 5 ms 256 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 380 KB Output is correct
2 Correct 5 ms 256 KB Output is correct
3 Correct 5 ms 256 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 256 KB Output is correct
2 Correct 5 ms 256 KB Output is correct
3 Correct 5 ms 376 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 256 KB Output is correct
2 Correct 5 ms 256 KB Output is correct
3 Correct 5 ms 256 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 256 KB Output is correct
2 Correct 5 ms 256 KB Output is correct
3 Correct 5 ms 256 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 10 ms 504 KB Output is correct
2 Correct 10 ms 504 KB Output is correct
3 Correct 10 ms 504 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 10 ms 504 KB Output is correct
2 Correct 11 ms 504 KB Output is correct
3 Correct 10 ms 504 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 10 ms 504 KB Output is correct
2 Correct 10 ms 504 KB Output is correct
3 Correct 11 ms 504 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 10 ms 504 KB Output is correct
2 Correct 11 ms 504 KB Output is correct
3 Correct 10 ms 504 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 10 ms 504 KB Output is correct
2 Correct 10 ms 504 KB Output is correct
3 Correct 10 ms 504 KB Output is correct