Submission #232627

# Submission time Handle Problem Language Result Execution time Memory
232627 2020-05-17T17:31:11 Z crossing0ver Traffic (IOI10_traffic) C++17
Compilation error
0 ms 0 KB
#include<bits/stdc++.h>
#include "grader.h"
using namespace std; 
int dp[1000006], C[1000006] , tot; 
vector <int> adj[1000005];
void dfs(int v,int p) {
	dp[v] = 0;
	int s = 0;
	int r = 0;
	for (int i:adj[v]) {
		if (i != v) {
			r++;
			dfs (i,v);
			s += dp[i] + C[i];
			dp[v] = max(dp[v], dp[i] + C[i]);
		}
	}
}

int LocateCentre(int n,int P[],int S[],int D[]) {
	  for (int i = 0; i < n-1; i++)
	  	adj[S[i]].push_back(D[i]),
	  	adj[D[i]].push_back(S[i]),
	  	C[i] = P[i], tot += C[i];
	pair<int,int> ans = {INT_MAX,-1};
	for (int i = 0; i < n; i++) {
		dfs(i,-1);
		ans = min(ans,{dp[i],i});
	}
	return ans.second;
}

Compilation message

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