# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
148394 | Welcome to osu! (#200) | HicCup (FXCUP4_hiccup) | C++17 | 5 ms | 384 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 <bits/stdc++.h>
#include "hiccup.h"
using namespace std;
int HicCup(std::string S)
{
int cnt = 0;
for(int i=0; i<S.size(); i++){
if(S[i]=='H') cnt++;
else cnt--;
if(cnt<0){
cout << -1;
return 0;
}
}
if(cnt!=0) cout << -1;
else cout << 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |