Submission #148404

# Submission time Handle Problem Language Result Execution time Memory
148404 2019-09-01T04:18:24 Z 요까할 로뭘 은명팀(#3558, mario05092929, foja001, earthk) HicCup (FXCUP4_hiccup) C++17
0 / 100
5 ms 128 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 ch = 0;
	for(char x : S)
    {
        if(x == 'C')
        {
            if(st.empty()) return -1;
            st.pop();
        }
        else st.push(1);
    }
    if(st.empty()) return 1;
	else return -1;
}

Compilation message

hiccup.cpp: In function 'int HicCup(std::__cxx11::string)':
hiccup.cpp:7:6: warning: unused variable 'N' [-Wunused-variable]
  int N = S.size();
      ^
hiccup.cpp:8:6: warning: unused variable 'ch' [-Wunused-variable]
  int ch = 0;
      ^~
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 128 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 128 KB Output isn't correct
2 Halted 0 ms 0 KB -