제출 #162641

#제출 시각아이디문제언어결과실행 시간메모리
162641demetre게임 (IOI14_game)C++14
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h> using namespace std; int n, a, b, f[10001][10001], fix[10001], p[10001]; int getcol (int l){ if (l == p[l]) return l; return getcol (p[l]); } void col (int k, int l){ int w = getcol(k); int u = getcol(l); p[w] = u; fix[u]+=fix[w]; fix[w] = 0; p[k] = l; for (int i = 0; i < n; i++){ f[u][i]+=f[w][i]; f[i][u]+=f[i][w]; } } int main (){ cin >> n; for (int i=0; i<n; i++){ p[i] = i; fix[i] = 1; } for (int i=1; i<=n*(n-1)/2; i++){ cin >> a >> b; a = getcol(a); b = getcol(b); f[a][b]++; f[b][a]++; if (f[a][b] == fix[a]*fix[b]){ cout << "YES" << endl; if (fix[a] >= fix[b]) swap(a, b); col (a, b); } else cout << "NO" << endl; } }

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

/tmp/ccV9JMwh.o: In function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'
/tmp/cc6q57ie.o:game.cpp:(.text.startup+0x0): first defined here
/tmp/ccV9JMwh.o: In function `main':
grader.cpp:(.text.startup+0x14): undefined reference to `initialize(int)'
grader.cpp:(.text.startup+0x57): undefined reference to `hasEdge(int, int)'
collect2: error: ld returned 1 exit status