제출 #596488

#제출 시각아이디문제언어결과실행 시간메모리
596488Elias게임 (IOI14_game)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> #ifndef _DEBUG #include "game.h" #endif using namespace std; #define int long long vector<int> parent; // logn union find vector<int> remain; int find(int a) { return parent[a] = ((parent[a] == a) ? a : find(a)); } void initialize(int n) { parent = remain = vector<int>(n); for (int i = 0; i < n; i++) { parent[i] = i; remain[i] = n - 1; } } // if the remaining edge is queried, it exists, otherwise it doesn't. This guarantees there are at least 2 groups left until the end int hasEdge(int u, int v) { u = find(u); v = find(v); remain[u]--; remain[v]--; if (remain[u] == 0 || remain[v] == 0) { parent[u] = v; remain[v] += remain[u]; return 1; } return 0; }

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

/usr/bin/ld: /tmp/ccHDAaRM.o: in function `main':
grader.cpp:(.text.startup+0x2a): undefined reference to `initialize(int)'
/usr/bin/ld: grader.cpp:(.text.startup+0x94): undefined reference to `hasEdge(int, int)'
collect2: error: ld returned 1 exit status