# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
148562 | 2019-09-01T04:40:10 Z | 1 WA = 5 Push Up(#3624, BaaaaaaaaaaaaaaaarkingDog, IohcEjnim, 0xrgb) | HicCup (FXCUP4_hiccup) | C++17 | 0 ms | 0 KB |
#include "header.h" #include <bits/stdc++.h> using namespace std; int N; int myS[1000010]; int HicCup(std::string S) { N = S.size(); stack <int> ST; for (int i = 0; i < N; i++) { if (S[i] == 'H') ST.push(i); if (S[i] == 'S') { if (ST.empty()) return -1; myS[ST.top()] = i; ST.pop(); } } if (!ST.empty()) return -1; return 0; }