# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
473640 | iulia13 | 수도 (JOI20_capital_city) | C++14 | 1025 ms | 43492 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
vector <int> g[N];
int color[N], viz[N], sz[N], team[N], newDad[N], usedColor[N], newViz[N];
vector <int> col[N];
int n, k, ans = N;
void dfsSize(int nod, int dad, int boss)
{
sz[nod] = 1;
newViz[nod] = 0;
team[nod] = boss;
newDad[nod] = dad;
usedColor[color[nod]] = 0;
for (auto son : g[nod])
{
if (son == dad || viz[son])
continue;
dfsSize(son, nod, boss);
sz[nod] += sz[son];
}
}
int findCentroid(int nod, int dad, int myN)
{
for (auto son : g[nod])
{
if (son == dad || viz[son])
continue;
if (sz[son] > myN / 2)
# | 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... |