Submission #592456

#TimeUsernameProblemLanguageResultExecution timeMemory
592456PiejanVDCStations (IOI20_stations)C++17
0 / 100
4 ms656 KiB
#include <bits/stdc++.h> #include "stations.h" using namespace std; vector<int>label(int n, int k, vector<int>u, vector<int>v) { vector<int>l(n); for(int i = 0 ; i < n ; i++) l[i] = i; return l; } vector<set<int>>sub; void dfs(int u) { if(2*u+1 < 1000) { dfs(2*u+1); for(auto it = sub[2*u+1].begin() ; it != sub[2*u+1].end() ; it++) sub[u].insert(*it); } if(2*u+2 < 100) { dfs(2*u+2); for(auto it = sub[2*u+2].begin() ; it != sub[2*u+2].end() ; it++) sub[u].insert(*it); } sub[u].insert(u); } void gen() { const int n = 1000; dfs(0); } bool f; int find_next_station(int s, int t, vector<int>c) { if(!f) gen(); f = 1; for(int i = 1 ; i < (int)c.size() ; i++) if(sub[c[i]].find(t) != sub[c[i]].end()) return c[i]; return c[0]; }

Compilation message (stderr)

stations.cpp: In function 'void gen()':
stations.cpp:29:15: warning: unused variable 'n' [-Wunused-variable]
   29 |     const int n = 1000;
      |               ^
#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...