제출 #1024336

#제출 시각아이디문제언어결과실행 시간메모리
1024336Ahmed_Solyman기지국 (IOI20_stations)C++14
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; #include "stations.h" typedef long long ll; vector<vector<int>>adj; int mark=0; vector<int>in,vis; void dfs(int node,int par){ in[node]=mark++;vis[i]=1; for(auto i:adj[node]){ if(i!=par)dfs(i,node); } } vector<int> label(int n, int k, vector<int> u, vector<int> v){ mark=0; adj.resize(n); in.resize(n);vis.resize(n); for(int i=0;i<n-1;i++){ adj[u[i]].push_back(v[i]); adj[v[i]].push_back(u[i]); } for(int i=0;i<n;i++){ if(adj[i].size()==1){ dfs(i,i);break; } } return in; } int find_next_station(int s, int t,vector<int> c){ int p=0; for(auto i:c){ if(i<=s){ p=i;continue; } if(i<=t){ return i; } } return p; }

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

stations.cpp: In function 'void dfs(int, int)':
stations.cpp:10:25: error: 'i' was not declared in this scope; did you mean 'in'?
   10 |     in[node]=mark++;vis[i]=1;
      |                         ^
      |                         in