Submission #1024339

#TimeUsernameProblemLanguageResultExecution timeMemory
1024339Ahmed_Solyman기지국 (IOI20_stations)C++14
Compilation error
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; void dfs(int node,int par){ in[node]=mark++; for(auto i:adj[node]){ if(!vis[i])dfs(i,node); } } vector<int> label(int n, int k, vector<int> u, vector<int> v){ mark=0; adj.resize(n); in.resize(n); for(int i=0;i<(int)u.size();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; }

Compilation message (stderr)

stations.cpp: In function 'void dfs(int, int)':
stations.cpp:12:13: error: 'vis' was not declared in this scope
   12 |         if(!vis[i])dfs(i,node);
      |             ^~~