제출 #475200

#제출 시각아이디문제언어결과실행 시간메모리
475200AdamGSStations (IOI20_stations)C++14
컴파일 에러
0 ms0 KiB
#include "stations.h" #include<bits/stdc++.h> using namespace std; typedef long double ld; #define rep(a, b) for(int a = 0; a < (b); ++a) #define st first #define nd second #define pb push_back #define all(a) a.begin(), a.end() const int LIM=1e3+7; int pre[LIM], post[LIM], lpre, lpost; void DFS(int x, int o) { ++lpre; pre[x]=lpre; for(auto i : V[x]) if(i!=o) DFS(i, x); ++lpost; post[x]=lpost; } vector<int>label(int n, int k, vector<int>u, vector<int>v) { vector<int>ans(n), V[n]; rep(i, n-1) { V[u[i]].pb(v[i]); V[v[i]].pb(u[i]); } DFS(0, 0); rep(i, n) ans[i]=i; return ans; } int find_next_station(int s, int t, vector<int>c) { int ojciec=-1; for(auto i : c) if(pre[i]<pre[s]) ojciec=i; for(auto i : c) if(i!=ojciec && pre[i]<=pre[t] && post[i]>=post[t]) return i; return ojciec; }

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

stations.cpp: In function 'void DFS(int, int)':
stations.cpp:15:15: error: 'V' was not declared in this scope
   15 |  for(auto i : V[x]) if(i!=o) DFS(i, x);
      |               ^