제출 #553974

#제출 시각아이디문제언어결과실행 시간메모리
553974a_aguiloTraffic (IOI10_traffic)C++14
컴파일 에러
0 ms0 KiB
#include "traffic.h" #include<bits/stdc++.h> using namespace std; int dfs (int padre, int nodo, vector<vector<int>>& listaAdy, int pop[], vector<vector<int>>& dp){ if(dp[nodo][padre] != -1) return dp[nodo][padre]; dp[nodo][padre] = pop[nodo]; for(int conexion: listaAdy[nodo]){ if(conexion != padre) dp[nodo][padre]+= dfs(nodo, conexion, listaAdy, pop, dp); } return dp[nodo][padre]; } int LocateCentre(int N, int pp[], int S[], int D[]) { vector<vector<int>> listaAdy(N); for(int i= 0; i < N; ++i){ int a = S[i]; int b = D[i]; listaAdy[a].push_back(b); } vector<vector<int>> dp(N, vector<int> N(-1)); pair<int, int> ans = make_pair(1e9, 0); for(int ciudad = 0; ciudad < n; ++ciudad){ int act = -1e9; for(int conex: listaAdy[ciudad]){ act = max(act, dfs(ciudad, conex, listaAdy, pp, dp)); } ans = min(ans, make_pair(act, ciudad)); } return ans.second; }

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

traffic.cpp: In function 'int LocateCentre(int, int*, int*, int*)':
traffic.cpp:22:42: error: expected primary-expression before 'N'
   22 |    vector<vector<int>> dp(N, vector<int> N(-1));
      |                                          ^
traffic.cpp:24:33: error: 'n' was not declared in this scope
   24 |    for(int ciudad = 0; ciudad < n; ++ciudad){
      |                                 ^