# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
313912 |
2020-10-17T09:23:00 Z |
srvlt |
Stations (IOI20_stations) |
C++14 |
|
897 ms |
1248 KB |
#include "stations.h"
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define SZ(x) (int)(x).size()
#define all(x) begin(x), end(x)
int T;
vector <int> g[1003], ind, d;
void dfs(int v, int p) {
if (!d[v]) ind[v] = T++;
for (int to : g[v]) {
if (to == p) continue;
d[to] = d[v] ^ 1;
dfs(to, v);
}
if (d[v]) ind[v] = T++;
}
vector<int> label(int n, int k, vector<int> u, vector<int> v) {
T = 0;
ind.resize(n);
d.resize(n);
for (int i = 0; i < n; i++) g[i].clear();
for (int i = 0; i < SZ(u); i++)
g[u[i]].pb(v[i]), g[v[i]].pb(u[i]);
d[0] = 0;
dfs(0, 0);
return ind;
}
int find_next_station(int s, int t, vector<int> c) {
for (int i = 0; i < SZ(c) - 1; i++)
if (t >= s && t <= c[i])
return c[i];
return c.back();
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
538 ms |
1248 KB |
Wrong query response. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
471 ms |
796 KB |
Wrong query response. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
532 ms |
1024 KB |
Wrong query response. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
897 ms |
876 KB |
Output is correct |
2 |
Incorrect |
681 ms |
876 KB |
Wrong query response. |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
601 ms |
1024 KB |
Wrong query response. |
2 |
Halted |
0 ms |
0 KB |
- |