# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
732069 | ollel | Network (BOI15_net) | C++17 | 1 ms | 340 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;
#include <iostream>
typedef vector<int> vi;
typedef vector<vi> vvi;
#define pb push_back
#define rep(i,a,b) for(int i = a; i < b; i++)
int n;
vvi g;
vi leaf;
int total_leafs;
vvi groups;
void dfs(int x, int p) {
for (auto y : g[x]) {
if (y == p) continue;
dfs(y, x);
leaf[x] += leaf[y];
}
}
bool test(int r) {
if (g[r].size() == 1) return false;
for (auto y : g[r]) if (leaf[y] <= leaf[r]) if (leaf[y] > total_leafs / 2) return false;
if (total_leafs - leaf[r] > total_leafs / 2) return false;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |