Submission #544973

#TimeUsernameProblemLanguageResultExecution timeMemory
544973PiejanVDCStations (IOI20_stations)C++17
0 / 100
3064 ms2097152 KiB
#include <bits/stdc++.h> #include "stations.h" using namespace std; const int mxN = 1005; vector<bitset<mxN>>mp(mxN); vector<int>adj[mxN]; void dfs(int u, int e = -1) { mp[u] |= 1 << u; for(auto z : adj[u]) if(z != e) { dfs(z,u); mp[u] |= mp[z]; } } vector<int>label(int n, int k, vector<int>u, vector<int>v) { for(int i = 0 ; i < n-1 ; i++) adj[u[i]].push_back(v[i]), adj[v[i]].push_back(u[i]); vector<int>ret(n); for(int i = 0 ; i < n ; i++) { dfs(i); ret[i] = i; } return ret; } int find_next_station(int s, int t, vector<int>c) { for(auto z : c) { if(mp[z][t]) return z; } }

Compilation message (stderr)

stations.cpp: In function 'int find_next_station(int, int, std::vector<int>)':
stations.cpp:36:1: warning: control reaches end of non-void function [-Wreturn-type]
   36 | }
      | ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...