Submission #148592

# Submission time Handle Problem Language Result Execution time Memory
148592 2019-09-01T04:43:53 Z 코딩은 체육과목입니다(#3561, jwvg0425, 16silver, jhuni) HicCup (FXCUP4_hiccup) C++17
Compilation error
0 ms 0 KB
#include "hiccup.h"

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

Compilation message

hiccup.cpp: In function 'int HicCup(std::__cxx11::string)':
hiccup.cpp:14:9: error: expected primary-expression before ')' token
  if(st!=) return -1;
         ^