# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|
150722 | | Solo Leveling (#200) | HicCup (FXCUP4_hiccup) | C++17 | | 23 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;
struct item{
int h , c , x;
};
int HicCup(std::string S) {
int N = S.size();
stack<int> s;
bool can = true;
for(int i = 0 ; i < N ; i ++){
if(S[i] == 'H') s.push(i);
else{
if(s.empty()) can = false;
else{
s.pop();
}
}
}
if(s.size()) can = false;
if(can) return 0;
else return -1;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |