Submission #1024346

#TimeUsernameProblemLanguageResultExecution timeMemory
1024346Ahmed_SolymanStations (IOI20_stations)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; #include "stations.h" typedef long long ll; vector<vector<int>>adj; vector<int>ret; int mark=0; void dfs(int node,int par){ ret[node]=mark++;; for(auto i:adj[node]){ if(i!=par)dfs(i,node); } } vector<int> label(int n, int k, vector<int> u, vector<int> v){ ret.resize(n); adj.resize(n); for(int i=0;i<n-1;i++){ adj[u[i]].push_back(v[i]); adj[v[i]].push_back(u[i]); } int root=0; for(int i=0;i<n;i++){ if(adj[i].size()==1)root=i; } dfs(root); return ret; } int find_next_station(int s, int t,vector<int> c){ if((int)c.size()==1)return c[0]; else if(t>s)return t+1; else return t-1; }

Compilation message (stderr)

stations.cpp: In function 'std::vector<int> label(int, int, std::vector<int>, std::vector<int>)':
stations.cpp:26:13: error: too few arguments to function 'void dfs(int, int)'
   26 |     dfs(root);
      |             ^
stations.cpp:9:6: note: declared here
    9 | void dfs(int node,int par){
      |      ^~~