Submission #372756

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
3727562021-03-01 13:25:24Drew_Traffic (IOI10_traffic)C++14
Compilation error
0 ms0 KiB
//#include <traffic.h>
#include <iostream>
#include <vector>
#include <functional>
using namespace std;
#define pb push_back
int LocateCentre(int N, int P[], int S[], int D[])
{
vector<vector<int>> adj(N);
for (int i = 0; i < N-1; ++i)
adj[S[i]].pb(D[i]), adj[D[i]].pb(S[i]);
vector<int> sz(N, 0);
vector<bool> vst(N, false);
function<int(int)> dfs = [&](int node)
{
vst[node] = true;
sz[node] = P[node];
for (int to : adj[node])
{
if (!vst[to])
sz[node] += sz[to];
}
return sz[node];
};
dfs(0);
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

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