# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
144237 | TadijaSebez | Split the Attractions (IOI19_split) | C++14 | 1070 ms | 1048580 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 "split.h"
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
const int N=100050;
int n,fir,sec,fm,sm;
vector<int> G[N],E[N];
void AddEdge(int u, int v){ G[u].pb(v);G[v].pb(u);}
int ans[N],sz[N],par[N];
bool was[N];
bool ok;
int ver,col;
void Tree(int u)
{
sz[u]=1;
was[u]=1;
for(int v:G[u]) if(!was[v])
{
Tree(v);
sz[u]+=sz[v];
E[u].pb(v);
par[v]=u;
}
if(sz[u]>=fir && n-sz[u]>=sec){ ok=1;ver=u;col=1;}
if(sz[u]>=sec && n-sz[u]>=fir){ ok=1;ver=u;col=2;}
}
int Cen(int u){ for(int v:E[u]) if(sz[v]*2>n) return Cen(v);return u;}
int rem,mark;
void DFS(int u)
{
Compilation message (stderr)
# | 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... |