# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
319711 |
2020-11-06T08:53:39 Z |
Drew_ |
Stations (IOI20_stations) |
C++14 |
|
897 ms |
1132 KB |
#include "stations.h"
#include <vector>
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
std::vector<int> label(int n, int k, std::vector<int> u, std::vector<int> v) {
std::vector<int> labels(n, -1);
vector<vector<int>> adj(n);
for (int i = 0; i < n-1; ++i)
{
adj[u[i]].pb(v[i]);
adj[v[i]].pb(u[i]);
}
int ctr = 0;
function<void (int)> dfs = [&](int node)
{
labels[node] = ctr++;
for (int to : adj[node])
{
if (labels[to] == -1)
dfs(to);
}
};
dfs(0);
return labels;
}
int find_next_station(int s, int t, std::vector<int> c) {
if (s < t)
{
for (int x : c)
if (x > s && x <= t)
{
return x;
}
}
return c[0];
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
548 ms |
988 KB |
Wrong query response. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
448 ms |
788 KB |
Wrong query response. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
521 ms |
988 KB |
Wrong query response. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
897 ms |
888 KB |
Output is correct |
2 |
Incorrect |
634 ms |
860 KB |
Wrong query response. |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
547 ms |
1132 KB |
Wrong query response. |
2 |
Halted |
0 ms |
0 KB |
- |