#include "stations.h"
#include <bits/stdc++.h>
using namespace std;
#define what_is(a) cout << #a << " is " << a << "\n"
#define checker(a) cout <"checker reached " << a << "\n"
vector<vector<int>> adj(1000,vector<int>());
vector<int> path;
void dfs(int u,int p){
path.push_back(u);
for(int v:adj[u])
if(v!=p)dfs(v,u);
}
std::vector<int> label(int n, int k, std::vector<int> u, std::vector<int> v) {
for(int i=0;i<n-1;i++){
adj[u[i]].push_back(v[i]);
adj[v[i]].push_back(u[i]);
}
int start = 0;
for(int i=0;i<n;i++)
if(adj[i].size()==0){
start = i;
break;
}
dfs(start,start);
vector<int> lbl(n);
for(int i=0;i<n;i++)
lbl[path[i]] = i;
return lbl;
}
int find_next_station(int s, int t, std::vector<int> c) {
if(c.size()==1)return c[0];
if(s<t)
return c[1];
else
return c[0];
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
2623 ms |
2097156 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
8 ms |
3496 KB |
Execution killed with signal 6 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1895 ms |
2097156 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
940 ms |
400 KB |
Output is correct |
2 |
Runtime error |
1526 ms |
2097156 KB |
Execution killed with signal 9 |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
3008 ms |
2097156 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |