답안 #870820

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
870820 2023-11-09T08:16:39 Z vjudge1 Magnus (COCI18_magnus) C++11
50 / 50
2 ms 856 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;
	
	
	for(int i = 0; i<n; i++) {
		if(str[i] == 'H') {
			int flag = 1;
			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:17:8: warning: unused variable 'flag' [-Wunused-variable]
   17 |    int flag = 1;
      |        ^~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 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 344 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 0 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 416 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 600 KB Output is correct
2 Correct 2 ms 856 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 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 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 2 ms 600 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 600 KB Output is correct
2 Correct 2 ms 604 KB Output is correct
3 Correct 2 ms 604 KB Output is correct