제출 #668913

#제출 시각아이디문제언어결과실행 시간메모리
668913someone즐거운 행로 (APIO20_fun)C++14
컴파일 에러
0 ms0 KiB
#include "fun.h" #include <bits/stdc++.h> #define int long long using namespace std; const int N = 1e5 + 42, INF = 1e18 + 42; int n, q, tmp[N]; vector<int> createFunTour(int NB, int Q) { n = NB, q = Q; int centroid = 0, dist = 0; for(int i = 1; i < n; i++) if(n - attractionsBehind(0, i) <= n/2) { int d = hoursRequired(0, i); if(d > dist) { dist = d; centroid = i; } } tmp[0] = dist; tmp[centroid] = 0; for(int i = 1; i < n; i++) if(i != centroid) tmp[i] = hoursRequired(i, centroid); priority_queue<pair<int, int>> pq; for(int i = 0; i < n; i++) pq.push({tmp[i], i}); deque<int> pre; vector<int> ans; for(int i = 0; i < n; i++) { int id = pq.top().second; pq.pop(); if(ans.empty()) ans.push_back(id); else { int last = ans.back(); if(tmp[last] + tmp[id] > hoursRequired(last, id)) pre.push_back(id); else { ans.push_back(id); if(!pre.empty()) { ans.push_back(pre[0]); pre.pop_front(); } } } } return ans; }

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

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