Submission #613087

# Submission time Handle Problem Language Result Execution time Memory
613087 2022-07-30T03:19:56 Z ajpiano HicCup (FXCUP4_hiccup) C++17
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
#include "hiccup.h"

using namespace std;

int HicCup(std::string S) {
	int N = S.size();
	int hbef = 0;
	for(int i = 0; i < N; i++){
		if(S[i] == '!') continue;
		if(S[i] == 'H') hbef++;
		else{
			hbef--;
			if(hbef < 0) return -1;
		}
	}
	if(hbef != 0) return -1;
	return 0;
}

int main(){
	string s; cin >> s;
	cout << HicCup(s) << "\n";
}

Compilation message

/usr/bin/ld: /tmp/ccvo6Iiv.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/cck8c6bw.o:hiccup.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status