제출 #924520

#제출 시각아이디문제언어결과실행 시간메모리
924520tosivanmak게임 (IOI14_game)C++17
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h> using namespace std; #define ll long long // #ifdef __cplusplus // extern "C" { // #endif // void initialize(int n); // int hasEdge(int u, int v); // #ifdef __cplusplus // } // #endif // TODO: global variables can be declared here ll cnt[1505]; ll cancut,outn; ll cutedges=0; void initialize(int n) { // TODO: implementation for(int i=0;i<1500;i++){ cnt[i]=0; } cancut=n*(n-1)/2-(n-1); outn=n; } int hasEdge(int u, int v) { // TODO: implementation cnt[u]++,cnt[v]++; if(cutedges>=cancut){ return 1; } cutedges++; if(cnt[u]==outn-1 or cnt[v]==outn-1){ return 1; } return 0; } int read_int() { int x; assert(scanf("%d", &x) == 1); return x; } int main() { int n, u, v; n = read_int(); initialize(n); for (int i = 0; i < n * (n - 1) / 2; i++) { u = read_int(); v = read_int(); printf("%d\n", hasEdge(u, v)); } return 0; }

컴파일 시 표준 에러 (stderr) 메시지

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