답안 #94864

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
94864 2019-01-24T16:40:56 Z karlopuh Magnus (COCI18_magnus) C++14
50 / 50
6 ms 632 KB
#include <bits/stdc++.h>
using namespace std;

string ulaz;
int brojac;
int stanje=0;

int main(){
	cin>>ulaz;
	for(int i=0;i<ulaz.size();i++){
		if(ulaz[i]=='H' && stanje==0){
			stanje=1;
		}
		else if(ulaz[i]=='O' && stanje==1){
			stanje=2;
		}
		else if(ulaz[i]=='N' && stanje==2){
			stanje=3;
		}
		else if(ulaz[i]=='I' && stanje==3){
			stanje=0;
			brojac++;
		}
	}
	
	cout<<brojac;
}

Compilation message

magnus.cpp: In function 'int main()':
magnus.cpp:10:15: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for(int i=0;i<ulaz.size();i++){
              ~^~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 2 ms 380 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 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 2 ms 256 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 2 ms 376 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 252 KB Output is correct
2 Correct 2 ms 252 KB Output is correct
3 Correct 2 ms 256 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 632 KB Output is correct
2 Correct 6 ms 624 KB Output is correct
3 Correct 6 ms 632 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 632 KB Output is correct
2 Correct 6 ms 632 KB Output is correct
3 Correct 6 ms 632 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 628 KB Output is correct
2 Correct 5 ms 632 KB Output is correct
3 Correct 6 ms 632 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 632 KB Output is correct
2 Correct 6 ms 632 KB Output is correct
3 Correct 6 ms 632 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 632 KB Output is correct
2 Correct 5 ms 632 KB Output is correct
3 Correct 6 ms 632 KB Output is correct