답안 #148707

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
148707 2019-09-01T04:58:19 Z HSNU(#3687, joylintp, 147, wiwiho) HicCup (FXCUP4_hiccup) C++17
24 / 100
21 ms 4352 KB
#include<bits/stdc++.h>
#include "hiccup.h"

using namespace std;

int HicCup(string S)
{
	int N = S.size();

	stack<char> s;
	for (char c : S)
        if (s.empty())
            s.push(c);
        else if (s.top() == 'H' && c == 'C')
            s.pop();
        else
            s.push(c);

	return s.empty() - 1;
}

Compilation message

hiccup.cpp: In function 'int HicCup(std::__cxx11::string)':
hiccup.cpp:8:6: warning: unused variable 'N' [-Wunused-variable]
  int N = S.size();
      ^
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 384 KB Output is correct
2 Correct 6 ms 384 KB Output is correct
3 Correct 5 ms 384 KB Output is correct
4 Correct 6 ms 512 KB Output is correct
5 Correct 20 ms 3328 KB Output is correct
6 Correct 20 ms 3328 KB Output is correct
7 Correct 21 ms 3328 KB Output is correct
8 Correct 21 ms 3328 KB Output is correct
9 Correct 20 ms 3328 KB Output is correct
10 Correct 21 ms 3328 KB Output is correct
11 Correct 5 ms 384 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 384 KB Output is correct
2 Correct 6 ms 384 KB Output is correct
3 Correct 5 ms 384 KB Output is correct
4 Correct 6 ms 512 KB Output is correct
5 Correct 20 ms 3328 KB Output is correct
6 Correct 20 ms 3328 KB Output is correct
7 Correct 21 ms 3328 KB Output is correct
8 Correct 21 ms 3328 KB Output is correct
9 Correct 20 ms 3328 KB Output is correct
10 Correct 21 ms 3328 KB Output is correct
11 Correct 19 ms 3712 KB Output is correct
12 Correct 19 ms 4224 KB Output is correct
13 Correct 17 ms 4352 KB Output is correct
14 Correct 5 ms 384 KB Output is correct
15 Correct 18 ms 4352 KB Output is correct
16 Correct 6 ms 384 KB Output is correct
17 Correct 6 ms 384 KB Output is correct
18 Correct 7 ms 640 KB Output is correct
19 Incorrect 16 ms 4352 KB Output isn't correct
20 Halted 0 ms 0 KB -