Submission #616101

#TimeUsernameProblemLanguageResultExecution timeMemory
616101John3_141592Stations (IOI20_stations)C++14
8 / 100
963 ms576 KiB
#include "stations.h" #include <bits/stdc++.h> using namespace std; std::vector<int> label(int n, int k, std::vector<int> u, std::vector<int> v) { vector <int> vec; for(int i=0;i<n;i++) vec.push_back(i); return vec; } int find_next_station(int s, int t, std::vector<int> c) { if(c.size()==1) return c[0]; if(!s){ int l=c[0],r=c[1]; while(t>r) l=2*l+1,r=2*r+2; if(t-l<r-t) return c[0]; return c[1]; } if(c.size()==2){ if(t==c[1]) return c[1]; return c[0]; } int l=c[1],r=c[2]; while(t>r) l=2*l+1,r=2*r+2; if(t<l) return c[0]; if(t-l<r-t) return c[1]; return c[2]; }
#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...