# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
921479 | ksujay2 | 기지국 (IOI20_stations) | C++17 | 620 ms | 1388 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
vector<int> label(int n, int k, vector<int> u, vector<int> v) {
vector<vector<int>> adj(n);
for(int i = 0; i < n - 1; i++) {
adj[u[i]].push_back(v[i]);
adj[v[i]].push_back(u[i]);
}
int t = 0;
vector<int> label(n);
function<void(int, int, int)> dfs = [&] (int s, int e, int p) {
if(!p) label[s] = t++;
for(int u : adj[s]) {
if(u != e) {
dfs(u, s, p ^ 1);
}
}
if(p) label[s] = t++;
};
dfs(0, -1, 0);
return label;
}
int find_next_station(int s, int t, vector<int> c) {
bool mn = true;
for(int u : c) {
if(u < s) {
mn = false;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |