#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;
cout << er[i] << '\n';
}
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 |
1 ms |
256 KB |
Invalid length of array as the response of 'label'. scenario=0, n=10, len=19 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
384 KB |
Invalid length of array as the response of 'label'. scenario=0, n=996, len=1991 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
256 KB |
Invalid length of array as the response of 'label'. scenario=0, n=2, len=3 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
364 KB |
Invalid length of array as the response of 'label'. scenario=0, n=2, len=3 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
256 KB |
Invalid length of array as the response of 'label'. scenario=0, n=3, len=5 |
2 |
Halted |
0 ms |
0 KB |
- |