제출 #148358

#제출 시각아이디문제언어결과실행 시간메모리
148358먀 (#200)HicCup (FXCUP4_hiccup)C++17
24 / 100
20 ms3328 KiB
#include "hiccup.h"

int HicCup(std::string S) {
	int V = 0;
	for(int i=0;i<S.size();i++) {
		if(S[i] == 'H') V++;
		if(S[i] == 'C') {
			if(!V) return -1;
			V--;
		}
	}
	return (V == 0) - 1;
}

컴파일 시 표준 에러 (stderr) 메시지

hiccup.cpp: In function 'int HicCup(std::__cxx11::string)':
hiccup.cpp:5:15: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for(int i=0;i<S.size();i++) {
              ~^~~~~~~~~
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…