Submission #305697

#TimeUsernameProblemLanguageResultExecution timeMemory
305697arthurconmyStations (IOI20_stations)C++14
8 / 100
1178 ms996 KiB
#ifndef ARTHUR_LOCAL #include "stations.h" #endif #ifdef ARTHUR_LOCAL #include <bits/stdc++.h> #endif using namespace std; using ll = long long; vector<int> adj[1001]; bool vis[1001]; int curv; int labellist[1001]; void dfs(int v) { vis[v]=1; labellist[v]=curv++; for(auto u:adj[v]) { if(!vis[u]) dfs(u); } } vector<int> label(int n, int k, vector<int> U, vector<int> V) { vector<int> ans; for(int i=0; i<n; i++) ans.push_back(i); return ans; } int find_next_station(int s, int t, vector<int> C) { vector<int> level(1001); level[0]=1; for(int i=0; i<=1000; i++) { if(2*i + 1 <= 1000) level[2*i + 1] = 1 + level[i]; if(2*i + 2 <= 1000) level[2*i + 2] = 1 + level[i]; // if(i<100) cout << i << " " << level[i] << endl; } if(s > t) return int((s-1)/2); int tt=t; while(tt > s) tt = int((tt-1)/2); if(tt != s) return C[0]; tt=t; while(int((tt-1)/2) != s) tt=int((tt-1)/2); return tt; } #ifdef ARTHUR_LOCAL int main() { cout << "ANS: " << find_next_station(0, 6, {1, 2}) << endl; } #endif
#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...