# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
582820 | LucaIlie | Stations (IOI20_stations) | C++17 | 3057 ms | 2097152 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>
#define MAX_N 1000
using namespace std;
int l;
vector<int> edges[MAX_N];
vector<int> labels;
void dfs( int u, int p, int d ) {
if ( d == 0 )
labels[u] = l * 2;
l++;
for ( int v: edges[u] ) {
if ( v != p )
dfs( v, u, 1 - d );
}
if ( d == 1 )
labels[u] = l * 2 + 1;
if ( edges[u].size() > 1 )
l++;
}
vector<int> label( int n, int k, vector<int> u, vector<int> v ) {
for ( int i = 0; i < n - 1; i++ ) {
edges[u[i]].push_back( v[i] );
edges[v[i]].push_back( u[i] );
}
labels.resize( n );
l = 0;
dfs( 0, -1, 0 );
return labels;
}
int find_next_station( int s, int t, vector<int> c ) {
int l, r, d, i;
return c[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... |