답안 #870811

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
870811 2023-11-09T07:43:58 Z vjudge1 Magnus (COCI18_magnus) C++11
30 / 50
2 ms 604 KB
#include <bits/stdc++.h>
using namespace std;
using ll = long long;

int main(){

	string str;
	cin >> str;

	int n = str.size();

	int cnt = 0;
	int flag = 1;
	
	for(int i = 0; i<n; i++) {
		if(str[i] == 'H') {
			i++;
			while(str[i] != 'O' && i < n) i++;
			i++;
			while(str[i] != 'N' && i < n) i++;
			i++;
			while(str[i] != 'I' && i < n) i++;
			if(i == n) break;
			cnt++;
			continue;
		}	

		
	}
	cout << cnt << "\n";


	return 0;
}

Compilation message

magnus.cpp: In function 'int main()':
magnus.cpp:13:6: warning: unused variable 'flag' [-Wunused-variable]
   13 |  int flag = 1;
      |      ^~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 344 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 Incorrect 0 ms 348 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 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 0 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 Incorrect 2 ms 600 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 604 KB Output is correct
2 Correct 2 ms 604 KB Output is correct
3 Correct 2 ms 600 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 604 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 604 KB Output is correct
2 Correct 2 ms 604 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 Incorrect 2 ms 604 KB Output isn't correct
4 Halted 0 ms 0 KB -