Submission #528236

#TimeUsernameProblemLanguageResultExecution timeMemory
528236Leo121Traffic (IOI10_traffic)C++14
Compilation error
0 ms0 KiB
#include "grader.h" #include <bits/stdc++.h> #define forn(i, a, b) for(int i = int(a); i <= int(b); ++i) #define pb push_back using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef vector<int> vi; const int lim = 1e6; vi graph[lim]; int pesos[lim]; bool visitado[lim]; ll mayor = LLONG_MAX, res = 0; ll pesosub[lim]; int padre[lim]; ll dfs(int u){ pesosub[u] = (ll) pesos[u]; for(int v : graph[u]){ if(!visitados[v]){ padre[v] = u; visitados[v] = 1; pesosub[u] += dfs(v); } } return pesosub; } int LocateCentre(int N, int pp[], int S[], int D[]) { ll pesototal = 0; forn(i, 0, N - 1){ pesos[i] = pp[i]; pesototal += (ll) pp[i]; visitado[i] = 0; pesosub[i] = 0; } forn(i, 0, N - 2){ graph[S[i]].pb(D[i]); graph[D[i]].pb(S[i]); } visitado[0] = 1; padre[0] = 0; dfs(0); ll minimo = INT_MAX, aux = 0, sumaaux; int res = 0; for(int i : graph[0]){ aux = max(aux, pesosub[i]); } minimo = aux; forn(i, 1, N - 1){ aux = 0; for(int j : graph[i]){ if(padre[j] == i){ aux = max(aux, pesosub[j]); } } aux = max(aux, pesototal - pesosub[i]); if(mayor >= aux){ mayor = aux; res = i; } } return res; }

Compilation message (stderr)

traffic.cpp:1:10: fatal error: grader.h: No such file or directory
    1 | #include "grader.h"
      |          ^~~~~~~~~~
compilation terminated.