#include "stations.h"
#include <bits/stdc++.h>
using namespace std;
class pont{
public:
vector<int> v;
int be, ki;
bool volt = 0;
void dfs();
};
vector<pont> p;
int dd = -1;
void pont::dfs(){
if(!volt){
volt=1;
be=++dd;
for(int i : v){
p[i].dfs();
}
ki=++dd;
}
}
vector<int> label(int n, int k, vector<int> u, vector<int> v) {
dd=-1;
p.clear();
p.resize(n);
for(int i=0;i<n-1;i++){
p[u[i]].v.push_back(v[i]);
p[v[i]].v.push_back(u[i]);
}
p[0].dfs();
vector<int> er(n);
for(int i=0;i<n;i++){
er[i] = p[i].be*2000+p[i].ki;
}
return er;
}
bool contains(int mi, int mit){
return mi/2000 < mit/2000 && mit%2000 < mi%2000;
}
int find_next_station(int s, int t, vector<int> c) {
if(contains(s,t)){
for(int i : c){
if(contains(i,t)){
return i;
}
}
exit(255);
} else {
sort(c.begin(),c.end());
return c[0];
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
4 ms |
384 KB |
Invalid labels (values out of range). scenario=0, k=1000, vertex=1, label=14014 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
6 ms |
508 KB |
Invalid labels (values out of range). scenario=0, k=1000, vertex=0, label=1991 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
3 ms |
512 KB |
Invalid labels (values out of range). scenario=1, k=1000000, vertex=3, label=1157149 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
2 ms |
644 KB |
Execution failed because the return code was nonzero |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
4 ms |
1024 KB |
Execution failed because the return code was nonzero |
2 |
Halted |
0 ms |
0 KB |
- |