# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
401115 |
2021-05-09T12:02:13 Z |
dxz05 |
Stations (IOI20_stations) |
C++14 |
|
945 ms |
676 KB |
#include "stations.h"
#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1011;
vector<int> g[MAXN];
int tin[MAXN], timer = 0;
void dfs(int v, int p){
tin[v] = timer++;
for (int u : g[v]){
if (u != p) dfs(u, v);
}
}
vector<int> label(int n, int k, vector<int> U, vector<int> V) {
for (int i = 0; i < n; i++) g[i].clear();
timer = 0;
for (int i = 0; i < n - 1; i++){
g[U[i]].push_back(V[i]);
g[V[i]].push_back(U[i]);
}
dfs(0, -1);
vector<int> labels(n, 0);
for (int i = 0; i < n; i++){
labels[i] = tin[i];
}
return labels;
}
int find_next_station(int s, int t, vector<int> c) {
int ans = c[0];
for (int x : c){
if (x <= t && x > ans) ans = x;
}
return ans;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
520 ms |
524 KB |
Wrong query response. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
560 ms |
528 KB |
Wrong query response. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
661 ms |
676 KB |
Wrong query response. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
945 ms |
400 KB |
Output is correct |
2 |
Correct |
756 ms |
656 KB |
Output is correct |
3 |
Incorrect |
645 ms |
400 KB |
Wrong query response. |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
547 ms |
592 KB |
Wrong query response. |
2 |
Halted |
0 ms |
0 KB |
- |