# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
305693 | arthurconmy | Stations (IOI20_stations) | C++14 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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<n; 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(s > t) return int((s-1)/2);
int ss=s;
while(ss > t) ss = int((ss-1)/2);
if(ss!=t) return C[0];
ss=s;
while(int((ss-1)/2)!=t) ss=int((ss-1)/2);
return ss;
}