# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
148521 | 2019-09-01T04:35:40 Z | 요까할 로뭘 은명팀(#3558, mario05092929, foja001, earthk) | HicCup (FXCUP4_hiccup) | C++17 | 22 ms | 3328 KB |
#include "hiccup.h" #include <bits/stdc++.h> using namespace std; stack <int> st; int HicCup(std::string S) { /// HicHup int n = S.size(); int ans = 0,sum = 0,s2 = 0,minn = 10000000,ch = 0; reverse(S.begin(),S.end()); for(char x : S) { if(x == 'C') st.push(1); else if(x == 'H') { if(st.empty()) return -1; st.pop(); sum++; ch = 0; minn = min(minn,s2/sum); } else { s2++; ch = 1; } } //cout << st.empty() << " " << sum << " " << s2 << " " << minn << '\n'; if(!st.empty()) return -1; else return max(minn,s2 / sum); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 6 ms | 384 KB | Output is correct |
2 | Correct | 5 ms | 384 KB | Output is correct |
3 | Correct | 6 ms | 384 KB | Output is correct |
4 | Correct | 6 ms | 512 KB | Output is correct |
5 | Correct | 22 ms | 3328 KB | Output is correct |
6 | Correct | 13 ms | 3328 KB | Output is correct |
7 | Correct | 13 ms | 3328 KB | Output is correct |
8 | Correct | 20 ms | 3328 KB | Output is correct |
9 | Correct | 21 ms | 3328 KB | Output is correct |
10 | Correct | 14 ms | 3328 KB | Output is correct |
11 | Correct | 5 ms | 384 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 6 ms | 384 KB | Output is correct |
2 | Correct | 5 ms | 384 KB | Output is correct |
3 | Correct | 6 ms | 384 KB | Output is correct |
4 | Correct | 6 ms | 512 KB | Output is correct |
5 | Correct | 22 ms | 3328 KB | Output is correct |
6 | Correct | 13 ms | 3328 KB | Output is correct |
7 | Correct | 13 ms | 3328 KB | Output is correct |
8 | Correct | 20 ms | 3328 KB | Output is correct |
9 | Correct | 21 ms | 3328 KB | Output is correct |
10 | Correct | 14 ms | 3328 KB | Output is correct |
11 | Correct | 15 ms | 3328 KB | Output is correct |
12 | Correct | 14 ms | 3328 KB | Output is correct |
13 | Correct | 13 ms | 3328 KB | Output is correct |
14 | Correct | 6 ms | 384 KB | Output is correct |
15 | Incorrect | 16 ms | 3328 KB | Output isn't correct |
16 | Halted | 0 ms | 0 KB | - |