# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
148536 | 2019-09-01T04:37:27 Z | TLEWA맞(#3625, H_Squad, sungjune222, str0ct) | HicCup (FXCUP4_hiccup) | C++17 | 22 ms | 3456 KB |
#include "hiccup.h" #include<algorithm> int HicCup(std::string S) { int H=0,C=0,A=0; int cnt; int N=S.size(); int flag=0; for(int i=0;i<N;i++){ if(!flag&&S[i]=='H')flag=1; if(S[i]=='H'&&i<N-1&&S[i+1]=='!'){ return -1; } if(S[i]=='H')H++; if(!flag&&S[i]=='C'){ return -1; } if(S[i]=='C'){ C++; cnt=0; } if(!flag&&S[i]=='!'){ return -1; } if(flag&&S[i]=='!'){ A++; cnt++; } } if(H!=C)return -1; return std::min(A/H,cnt); }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 7 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 | 3352 KB | Output is correct |
8 | Correct | 19 ms | 3376 KB | Output is correct |
9 | Correct | 21 ms | 3456 KB | Output is correct |
10 | Incorrect | 19 ms | 3352 KB | Output isn't correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 7 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 | 3352 KB | Output is correct |
8 | Correct | 19 ms | 3376 KB | Output is correct |
9 | Correct | 21 ms | 3456 KB | Output is correct |
10 | Incorrect | 19 ms | 3352 KB | Output isn't correct |