제출 #150283

#제출 시각아이디문제언어결과실행 시간메모리
150283오리버스부릉부릉 (#200)HicCup (FXCUP4_hiccup)C++17
24 / 100
20 ms3328 KiB
#include "hiccup.h" #include <stack> using namespace std; int HicCup(std::string S) { int N = S.size(); stack<int> sta; for (int i = 0; i < N; i++) { if (S[i] == 'H') { sta.push(1); } else { if (sta.empty()) return -1; else sta.pop(); } } if (!sta.empty()) return -1; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...