# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
149123 | 팀명못정해서15시간째고민중인팀 (#200) | HicCup (FXCUP4_hiccup) | C++17 | 22 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<bits/stdc++.h>
using namespace std;
int HicCup(std::string S) {
int N = S.size();
stack<int> st;
bool chk=true,r=false;
for(auto i:S){
if(i=='H') st.push(1);
else if(i=='C'){
if(!st.empty()&&st.top()) st.pop(),r=true;
else chk=false;
}
else if(!r) chk=false;
}
if(!st.empty()) chk=false;
return chk?0:-1;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |