# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1004492 | coolboy19521 | Railway (BOI17_railway) | C++17 | 50 ms | 29524 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.
#pragma GCC optimize("Ofast")
#include"bits/stdc++.h"
#define int long long
using namespace std;
const int sz = 1e5 + 5;
const int sm = 25;
vector<vector<int>> aj[sz];
int mp[sz], mn[sz];
int up[sm][sz];
vector<int> r;
int dp[sz];
int k;
void dfs1(int v, int p = 0, int d = 1) {
up[0][v] = p;
dp[v] = d;
for (auto& u : aj[v]) {
int to = u[0];
if (to != p) {
dfs1(to, v, d + 1);
}
}
}
void dfs2(int v, int p = 0, int s = 0) {
s += mp[v];
s -= mn[v];
# | 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... |