Submission #1311154

#TimeUsernameProblemLanguageResultExecution timeMemory
1311154ayathkStations (IOI20_stations)C++20
Compilation error
0 ms0 KiB
#include "stations.h" #include <bits/stdc++.h> using namespace std; #define int long long #define fi first #define se second #define all(a) a.begin(), a.end() vector<int> label(int n, int k, vector<int> u, vector<int> v) { vector<int> labels(n); vector <vector <int>> adj(n); for (int i = 0; i < n - 1; i++) { adj[u[i]].push_back(v[i]); adj[v[i]].push_back(u[i]); } queue <int> t; for(int i = 0;i < n;i++){ if(adj[i].size() == 1){ t.push(i); break; } } int cnt = 0; vector <bool> vis(n,0); while(!t.empty()){ int f = t.front(); t.pop(); vis[f] = 1; labels[f] = cnt; for(int i : adj[f]){ if(vis[i])continue; t.push(i); } cnt++; } return labels; } int find_next_station(int s, int t, vector<int> c) { if(t > s){ return max(c[0], c[1]); } return min(c[0],c[1]); } /*signed main(){ vector <int> a = label(5, 8 ,{4,1,2,3,0}, {0,4,0,2,2}); for(int i : a){ cout<<i<<' '; } }*/

Compilation message (stderr)

/usr/bin/ld: /tmp/ccAR6jT8.o: in function `main':
stub.cpp:(.text.startup+0x2b4): undefined reference to `label(int, int, std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >)'
/usr/bin/ld: stub.cpp:(.text.startup+0x4ce): undefined reference to `find_next_station(int, int, std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status