#include <bits/stdc++.h>
using namespace std;
vector <int> path[1111];
queue <int> walk;
int pass[1111];
vector <int> la;
vector <int> label(int n, int k, vector<int> u, vector<int> v)
{
la.clear();
int i,x;
for(i=0;i<n;i++)
{
pass[i]=0;
la.push_back(0);
}
x=u.size();
for(i=0;i<x;i++)
{
path[u[i]].push_back(v[i]);
path[v[i]].push_back(u[i]);
}
x=0;
while(path[x].size()!=1) x++;
walk.push(x);
x=0;
while(!walk.empty())
{
i=walk.front();
if(pass[i]==1) continue;
pass[i]=1;
la[i]=x;
x++;
for(auto a:path[i])
{
walk.push(a);
}
}
return la;
}
int find_next_station(int s, int t, vector<int> c)
{
if(s<t) return s+1;
else return s-1;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
3062 ms |
200 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
3046 ms |
328 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
3056 ms |
200 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
3052 ms |
200 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
3094 ms |
200 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |