제출 #68132

#제출 시각아이디문제언어결과실행 시간메모리
68132Just_Solve_The_Problem장난감 기차 (IOI17_train)C++11
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> #include "train.h" #include "grader.cpp" #define sz(s) (int)s.size() #define pb push_back #define all(s) s.begin(), s.end() using namespace std; const int N = (int)5e3 + 7; int has[N]; vector < int > gr[N], rev[N]; vector < int > a, r; vector < int > who_wins(vector < int > A, vector < int > R, vector < int > u, vector < int > v) { a = A; r = R; int n = sz(a); int m = sz(u); for (int i = 0; i < m; i++) { gr[u[i]].pb(v[i]); rev[v[i]].pb(u[i]); } vector < int > ans(n, 1); while (1) { vector < int > fa(n); queue < int > q; for (int i = 0; i < n; i++) { if (ans[i] && r[i]) { q.push(i); } else if (a[i]) { fa[i] = 1; } else { fa[i] = sz(gr[i]); } } while (sz(q)) { int v = q.front(); q.pop(); for (int to : rev[v]) { if (fa[to] == 1) q.push(to); fa[to]--; } } vector < int > fb(n); for (int i = 0; i < n; i++) { if (fa[i] > 0) { q.push(i); } else if (a[i]) { fb[i] = sz(gr[i]); } else { fb[i] = 1; } } while (sz(q)) { int v = q.front(); q.pop(); for (int to : rev[v]) { if (fb[to] == 1) q.push(to); fb[to]--; } } vector < int > prv(n); for (int i = 0; i < n; i++) prv[i] = (fb[i] > 0); if (prv == ans) return ans; else ans = prv; } }

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

/tmp/cc2vrpw9.o: In function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'
/tmp/cc0zWzbf.o:train.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status