#include "stations.h"
#include<bits/stdc++.h>
using namespace std;
typedef long double ld;
#define rep(a, b) for(int a = 0; a < (b); ++a)
#define st first
#define nd second
#define pb push_back
#define all(a) a.begin(), a.end()
vector<int>label(int n, int k, vector<int>u, vector<int>v) {
vector<int>ans(n, n), V[n];
rep(i, n-1) {
V[u[i]].pb(v[i]);
V[v[i]].pb(u[i]);
}
stack<int>q;
q.push(0);
int akt=0;
while(!q.empty()) {
int p=q.top(); q.pop();
ans[p]=akt; ++akt;
for(auto i : V[p]) if(ans[i]==n) q.push(i);
}
return ans;
}
int find_next_station(int s, int t, vector<int>c) {
if(t<s) {
for(auto i : c) if(i<s) return i;
}
int ans=0;
for(auto i : c) if(i<=t) ans=max(ans, i);
return ans;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
582 ms |
612 KB |
Wrong query response. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
561 ms |
528 KB |
Wrong query response. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
580 ms |
488 KB |
Wrong query response. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
886 ms |
480 KB |
Output is correct |
2 |
Correct |
794 ms |
400 KB |
Output is correct |
3 |
Incorrect |
618 ms |
484 KB |
Wrong query response. |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
558 ms |
488 KB |
Wrong query response. |
2 |
Halted |
0 ms |
0 KB |
- |