#include "stations.h"
#include <bits/stdc++.h>
#ifndef EVAL
#include "stub.cpp"
#endif
using namespace std;
typedef long long ll;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
#define precision(n) fixed << setprecision(n)
#define pb push_back
#define ub upper_bound
#define lb lower_bound
#define mp make_pair
#define eps (double)1e-9
#define PI 2*acos(0.0)
#define endl "\n"
#define sz(v) int((v).size())
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define do_not_disturb ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define OK cout << "OK" << endl;
vector <vector <int>> graph(1003);
int timer, tin[1003], tout[1003];
void dfs(int v, int p = 0){
tin[v] = ++timer;
for(auto to : graph[v]){
if(to != p){
dfs(to, v);
}
}
tout[v] = ++timer;
}
vector<int> label(int n, int k, vector<int> u, vector<int> v){
timer = 0;
for(int i = 0; i < n; i++){
graph[i].clear();
}
vector <int> labels(n);
for(int i = 0; i < sz(u); i++){
graph[u[i]].pb(v[i]);
graph[v[i]].pb(u[i]);
}
dfs(0);
for(int i = 0; i < n; i++){
labels[i] = tout[i];
}
return labels;
}
int find_next_station(int s, int t, vector<int> c){
if(c.back() < s){
auto it = lb(all(c), t);
return *it;
}
else{
if(t > c.back()) return c.back();
else{
auto it = lb(all(c), t);
return *it;
}
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
3 ms |
492 KB |
Invalid labels (values out of range). scenario=2, k=1000, vertex=0, label=1996 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
5 ms |
364 KB |
Invalid labels (values out of range). scenario=0, k=1000, vertex=0, label=1992 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
637 ms |
992 KB |
Wrong query response. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
916 ms |
864 KB |
Output is correct |
2 |
Correct |
802 ms |
864 KB |
Output is correct |
3 |
Incorrect |
626 ms |
864 KB |
Wrong query response. |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
663 ms |
896 KB |
Wrong query response. |
2 |
Halted |
0 ms |
0 KB |
- |