# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
321883 | wildturtle | 기지국 (IOI20_stations) | C++14 | 1067 ms | 1108 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<bits/stdc++.h>
using namespace std;
int A[1003],l,in[1003],out[1003],don[1003],mp[1003];
vector <int> v1[1003];
void dfs(int x,int y,int z) {
l++;
in[x]=l;
don[x]=z;
for(int i=0;i<v1[x].size();i++) {
if(v1[x][i]==y) continue;
dfs(v1[x][i],x,z+1);
}
l++;
out[x]=l;
}
std::vector<int> label(int n, int k, std::vector<int> u, std::vector<int> v) {
std::vector<int> labels(n);
for(int i=0;i<n;i++) {
v1[i].clear();
}
l=0;
for(int i=0;i<n-1;i++) {
v1[u[i]].push_back(v[i]);
v1[v[i]].push_back(u[i]);
}
dfs(0,-1,0);
for(int i=0;i<n;i++) {
if(don[i]%2==0) A[i]=in[i];
else A[i]=out[i];
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... |