# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1084143 | f0rizen | Factories (JOI14_factories) | C++17 | 3067 ms | 213720 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 "factories.h"
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int inf = 1e9 + 7;
const ll infll = 1e18;
struct Edge {
int to, w;
};
vector<vector<Edge>> g;
vector<bool> used;
vector<int> sz, par;
vector<vector<ll>> dist;
vector<ll> closest;
void dfs_sz(int v, int p = -1) {
sz[v] = 1;
for (auto [u, w] : g[v]) {
if (u != p && !used[u]) {
dfs_sz(u, v);
sz[v] += sz[u];
}
}
}
void dfs_dist(int v, int p = -1, ll d = 0) {
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |