답안 #13335

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
13335 2015-02-12T09:56:52 Z ggoh 게임 (IOI14_game) C++
컴파일 오류
0 ms 0 KB
#include<cstdio>
int w[1501],n,u,v;
void initialize(int n);
int hasEdge(int u,int v)
{
	if(w[u]==n-2||w[v]==n-2)
	{
		return 1;
	}
	else
	{
		w[u]++;
		w[v]++;
		return 0;
	}
}
main()
{
	initialize(n);
	for(int i=0;i<n*(n-1)/2;i++)
	{
		hasEdge(u,v);
	}
}

Compilation message

game.cpp:17:6: warning: ISO C++ forbids declaration of ‘main’ with no type [-Wreturn-type]
 main()
      ^
/tmp/ccyjUBa2.o: In function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'
/tmp/ccP1PUGw.o:game.cpp:(.text.startup+0x0): first defined here
/tmp/ccP1PUGw.o: In function `main':
game.cpp:(.text.startup+0xb): undefined reference to `initialize(int)'
/tmp/ccyjUBa2.o: In function `main':
grader.cpp:(.text.startup+0x14): undefined reference to `initialize(int)'
collect2: error: ld returned 1 exit status