This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "stations.h"
#include<bits/stdc++.h>
#define ss second
#define all(s) s.begin(),s.end()
#define sz(s) ll(s.size())
#define pb push_back
typedef long long ll;
const ll MAX=1e6;
using namespace std;
ll marc=1;
vector<ll> gfo[MAX];
ll m[MAX], tam[MAX];
bool vst[MAX];
// void bfs(int ini){
// queue<ll> q;
// q.pb(ini);
// m[ini]=mrc;
// while(sz(q)){
// ll x=q.front();
// q.pop();
// }
// }
vector<int> label(int n, int k, vector<int> u, vector<int> v){
vector<int> labels(n);
for(int i=0; i<sz(u); i++){
gfo[u[i]].pb(v[i]);
gfo[v[i]].pb(u[i]);
}
// for(int i=0; i<n; i++){
// cout<<i<<"-> ";
// for(auto v:gfo[i]){
// cout<<v<<' ';
// }
// cout<<'\n';
// }
for(int i=0; i<n; i++){
labels[i]=i+1;
}
// for(int i=0; i<n; i++){
// cout<<i<<' '<<labels[i]<<'\n';
// }
return labels;
}
int find_next_station(int s, int t, vector<int> c){
int ant=t;
//cout<<s<<'\n';
while(t){
if(t==s){
//cout<<t<<' '<<s<<'\n';
return ant;
}
ant=t;
t/=2;
}
return s/2;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |