# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
306171 | aljasdlas | Stations (IOI20_stations) | C++14 | 1081 ms | 1280 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 "stations.h"
#include <vector>
#include <bits/stdc++.h>
using namespace std;
vector<vector<int>> AdjList;
vector<int> labels;
int curLabel;
void dfs(int u, int p, int d) {
if(d%2==0)
labels[u] = curLabel++;
for(auto v: AdjList[u]) {
if(v != p)
dfs(v, u, d+1);
}
if(d%2)
labels[u] = curLabel++;
}
vector<int> label(int n, int k, vector<int> u, vector<int> v) {
// n = 10;
// u.resize(n);
// v.resize(n);
AdjList.assign(n, vector<int>(0));
labels.assign(n,-1);
curLabel = 0;
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... |