#include "stations.h"
#include <bits/stdc++.h>
#define rep(i,n)for(int i=0;i<int(n);i++)
using namespace std;
typedef long long ll;
std::vector<int> label(int n, int k, std::vector<int> u, std::vector<int> v) {
vector<int>labels(n);
rep(i,n)labels[i]=i;
return labels;
/*
vector<vector<int>>E(n);
vector<int>deg(n);
rep(i,n-1){
E[u[i]].push_back(v[i]);
E[v[i]].push_back(u[i]);
deg[u[i]]++;
deg[v[i]]++;
}
int s=-1;
rep(i,n){
if(deg[i]==1){s=i;break;}
}
vector<int>vs;
vector<int>labels(n,-1);
rep(i,n){
vs.push_back(s);
labels[s]=i;
for(int u:E[s]){
if(labels[u]==-1){
s=u;break;
}
}
}
return labels;*/
}
bool find(int r,int x){
int L=r,R=r;
while(L<=2000){
if(L<=x&&x<=R)return true;
L=L*2+1;
R=R*2+2;
}
return false;
}
int find_next_station(int s, int t, std::vector<int> c) {
if(find(s*2+1,t))return s*2+1;
if(find(s*2+2,t))return s*2+2;
return (s-1)/2;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
535 ms |
1040 KB |
Wrong query response. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
477 ms |
844 KB |
Output is correct |
2 |
Correct |
531 ms |
908 KB |
Output is correct |
3 |
Correct |
881 ms |
868 KB |
Output is correct |
4 |
Correct |
678 ms |
756 KB |
Output is correct |
5 |
Correct |
664 ms |
756 KB |
Output is correct |
6 |
Correct |
429 ms |
852 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
687 ms |
748 KB |
Wrong query response. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
964 ms |
884 KB |
Output is correct |
2 |
Incorrect |
759 ms |
868 KB |
Wrong query response. |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
585 ms |
860 KB |
Wrong query response. |
2 |
Halted |
0 ms |
0 KB |
- |