Submission #545144

#TimeUsernameProblemLanguageResultExecution timeMemory
545144PiejanVDCStations (IOI20_stations)C++17
0 / 100
3154 ms2097152 KiB
#include <bits/stdc++.h> #include "stations.h" using namespace std; const int mxN = 1005; map<pair<int,int>, bitset<mxN>>mp; vector<bitset<mxN>>ans(mxN); vector<int>adj[mxN]; bitset<mxN> dfs(int u, int e = -1) { bitset<mxN>b; for(auto z : adj[u]) if(z != e) { mp[{u,z}] |= dfs(z,u); mp[{u,z}][z] = 1; b |= mp[{u,z}]; } return b; } void Dfs(int u, int e, bitset<mxN>B) { for(auto z : adj[u]) if(z != e) { } } 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; } //Dfs(0, {}); return ret; } int find_next_station(int s, int t, vector<int>c) { for(auto z : c) { if(mp[{s,z}][t]) return z; } assert(0); }
#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...