제출 #598327

#제출 시각아이디문제언어결과실행 시간메모리
598327acatmeowmeowTraffic (IOI10_traffic)C++11
컴파일 에러
0 ms0 KiB
#include "grader.h" #include "traffic.h" #include <bits/stdc++.h> using namespace std; void dfs(int u, int e, vector<vector<int>>&adj, vector<int>&dp, int P[]) { dp[u] += P[u]; for (auto&v : adj[u]) { if (v == e) continue; dfs(v, u, adj, dp, P); dp[u] += dp[v]; } } void reroot(int u, int e, vector<vector<int>>&adj, vector<int>&dp, int P[], int&mn, int&ans) { int cur = 0; for (auto&v : adj[u]) cur = max(cur, dp[v]); if (cur < mn) mn = cur, ans = u; for (auto&v : adj[u]) { if (v == e) continue; dp[u] -= dp[v], dp[v] += dp[u]; reroot(v, u, adj, dp, P, mn, ans); dp[v] -= dp[u], dp[u] += dp[v]; } } int LocateCentre(int N, int P[], int S[], int D[]) { // build adjacency array vector<vector<int>> adj(N + 5); for (int i = 0; i < N - 1; i++) adj[S[i]].push_back(D[i]), adj[D[i]].push_back(S[i]); // dp vector<int> dp(N + 5); dfs(0, -1, adj, dp, P); // solve for all roots int mn = 1e18, ans = -1; reroot(0, -1, adj, dp, P, mn, ans); return ans; }

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

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