#include "stations.h"
#include <bits/stdc++.h>
using namespace std;
const int mxN = 1'001;
vector<int> adj[mxN];
int timer;
int temp[mxN];
void dfs(int v, int p){
temp[timer++] = v;
for(int i : adj[v]) {
if(i == p) continue;
dfs(i, v);
}
}
vector<int> label(int n, int k, vector<int> u, vector<int> v) {
vector<int> labels(n);
for(int i = 0; i < n; ++i){
adj[i].clear();
}
for(int i = 0; i < n - 1; ++i){
adj[u[i]].push_back(v[i]);
adj[v[i]].push_back(u[i]);
}
timer = 0;
dfs(0, -1);
for(int i = 0; i < n; ++i){
labels[i] = temp[i];
}
return labels;
}
int find_next_station(int s, int t, vector<int> c) {
sort(c.begin(), c.end());
if(t < s) {
return c[0];
} else {
int ans = 0;
for(int i : c){
if(t < i) break;
ans = i;
}
return ans;
}
}
//int main(){}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
637 ms |
1108 KB |
Wrong query response. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
555 ms |
884 KB |
Wrong query response. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
578 ms |
1104 KB |
Wrong query response. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1067 ms |
992 KB |
Output is correct |
2 |
Correct |
740 ms |
864 KB |
Output is correct |
3 |
Incorrect |
687 ms |
956 KB |
Wrong query response. |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
597 ms |
1108 KB |
Wrong query response. |
2 |
Halted |
0 ms |
0 KB |
- |