제출 #148410

#제출 시각아이디문제언어결과실행 시간메모리
148410요까할 로뭘 은명팀 (#200)HicCup (FXCUP4_hiccup)C++17
24 / 100
21 ms7424 KiB
#include "hiccup.h"
#include <bits/stdc++.h>
using namespace std;
stack <int> st;

int HicCup(std::string S) { /// HicHup
	int N = S.size();
	for(char x : S)
    {
        if(x == 'C')
        {
            if(st.empty()) return -1;
            st.pop();
        }
        else st.push(1);
    }
    if(st.empty()) return 0;
	else return -1;
}

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

hiccup.cpp: In function 'int HicCup(std::__cxx11::string)':
hiccup.cpp:7:6: warning: unused variable 'N' [-Wunused-variable]
  int N = S.size();
      ^
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…