Submission #151210

# Submission time Handle Problem Language Result Execution time Memory
151210 2019-09-02T08:13:52 Z rdd6584 HicCup (FXCUP4_hiccup) C++17
Compilation error
0 ms 0 KB
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "hiccup.h"

static char st[1000101]; static int len;

static void my_assert(int TF, const char* message){
	if(!TF){ puts(message); exit(0); }
}

int main(){
	my_assert(scanf("%s", st) == 1, "Error: Invalid Input");
	len = strlen(st);
	my_assert(1 <= len && len <= 1000000, "Error: Invalid Input");

	for(int i=0; i<len; i++){
		my_assert(st[i]=='H' || st[i]=='C' || st[i]=='!', "Error: Invalid Input");
	}

	std::string ss = st;
	printf("%d\n", HicCup(ss));
	return 0;
}

Compilation message

/tmp/ccVLwC09.o: In function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'
/tmp/ccM2wXHa.o:hiccup.cpp:(.text.startup+0x0): first defined here
/tmp/ccM2wXHa.o: In function `main':
hiccup.cpp:(.text.startup+0x11a): undefined reference to `HicCup(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)'
/tmp/ccVLwC09.o: In function `main':
grader.cpp:(.text.startup+0x11a): undefined reference to `HicCup(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)'
collect2: error: ld returned 1 exit status