#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[temp[i]] = 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 |
659 ms |
1116 KB |
Wrong query response. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
456 ms |
864 KB |
Wrong query response. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
539 ms |
1056 KB |
Wrong query response. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
978 ms |
948 KB |
Output is correct |
2 |
Correct |
742 ms |
948 KB |
Output is correct |
3 |
Incorrect |
623 ms |
992 KB |
Wrong query response. |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
515 ms |
992 KB |
Wrong query response. |
2 |
Halted |
0 ms |
0 KB |
- |