# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1091266 | MateiKing80 | Railway (BOI17_railway) | C++17 | 79 ms | 28148 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;
int main()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n, m, k;
cin >> n >> m >> k;
vector<vector<pair<int, int>>> adj(n + 1);
for (int i = 1; i < n; i++)
{
int x, y;
cin >> x >> y;
adj[x].push_back({y, i});
adj[y].push_back({x, i});
}
int K = 20;
vector<int> level(n + 1, 0), tin(n + 1, 0), sum(n + 1, 0), ind(n + 1, 0);
vector<vector<int>> up(K, vector<int> (n + 1, 0));
int t = 0;
function<void(int, int)> dfs = [&](int u, int p)
{
tin[u] = ++t;
up[0][u] = p;
for (int k = 1; k < K; k++)
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |