# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
202039 | HellAngel | Split the Attractions (IOI19_split) | C++14 | 0 ms | 0 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>
#define int long long
using namespace std;
const int maxn = 100007;
int ans, sz[maxn], n, m;
int col[maxn];
pair<int, int> a[4];
vector<int> vt[maxn];
void DFS(int u, int p)
{
sz[u] = 1;
for(auto v: vt[u])
{
if(v != p)
{
DFS(v, u);
sz[u] += sz[v];
}
}
}
int FindCen(int u, int p)
{
int Big = -1;
bool ok = true;
for(auto v: vt[u])
{
if(v == p) continue;
if(sz[v] * 2 > sz[1]) ok = false;