# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
148387 | 2019-09-01T04:15:40 Z | Welcome to osu!(#3734, easrui, CodePlatina, jhwest2) | HicCup (FXCUP4_hiccup) | C++17 | 0 ms | 0 KB |
#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; }