제출 #573467

#제출 시각아이디문제언어결과실행 시간메모리
573467MohamedFaresNebili게임 (IOI14_game)C++14
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> #include "game.h" #include <ext/pb_ds/assoc_container.hpp> using namespace std; using namespace __gnu_pbds; using ll = long long; using ii = pair<int, int>; using vi = vector<int>; #define pb push_back #define pp pop_back #define ff first #define ss second #define lb lower_bound #define int ll typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> indexed_set; set<int> adj[1501]; bool vis[1501]; void initialize(int n) { for(int l = 1; l <= n; l++) { for(int i = 1; i <= n; i++) { if(l == i) continue; adj[l].insert(i); } } } int hasEdge(int u, int v) { if(!vis[u] && !vis[v]) { if(adj[u].size() == 1 || adj[v].size() == 1) { vis[u] = vis[v] = 1; return 1; } adj[u].erase(v), adj[v].erase(u); return 0; } if(vis[u] && vis[v]) return 1; if(vis[u]) swap(u, v); if(adj[u].size() == 1) { vis[u] = 1; return 1; } adj[u].erase(v), adj[v].erase(u); return 0; }

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

/usr/bin/ld: /tmp/ccBt490X.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