# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
309718 | kris01 | Stations (IOI20_stations) | C++14 | 977 ms | 1132 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 pii pair <int,int>
#define mp make_pair
using namespace std;
vector < vector <int> > Adj; // Adjacency List for the graph
vector <int> Tin,Tout; // Entry and Exit times respectively
vector <int> Depth; // Depth of a given node from the root (node 1)
int timer = 0;
void DFS(int v,int p) {
Tin[v] = timer++;
for (int x : Adj[v]) {
if (x == p) continue;
Depth[x] = Depth[v] + 1;
DFS(x,v);
}
Tout[v] = timer++;
}
std::vector<int> label(int n, int k, std::vector<int> u, std::vector<int> v) {
std::vector<int> labels(n);
Adj.clear();
Tin.clear();
Tout.clear();
Depth.clear();
Adj.resize(n);
Tin.resize(n);
Tout.resize(n);
Depth.resize(n+1,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... |