# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
148799 | 욱방켜!! (twitch.tv/wookje) (#200) | HicCup (FXCUP4_hiccup) | C++17 | 21 ms | 3328 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "hiccup.h"
#include <stack>
using namespace std;
int HicCup(std::string S) {
int N = S.size();
stack<int> st; // -1 H, -2 C, n !
for(char c: S){
if(c == '!'){
return -1; // todo...
}
if(c == 'C'){
if(st.empty()) return -1;
st.pop();
}
else st.push(-1);
}
if(st.empty()) return 0;
return -1;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |