# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
873074 | serifefedartar | Capital City (JOI20_capital_city) | C++17 | 467 ms | 41816 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;
#define fast ios::sync_with_stdio(0);cin.tie(0);
#define s second
#define f first
typedef long long ll;
const ll MOD = 1e9+9;
const ll LOGN = 20;
const ll MAXN = 2e5 + 100;
vector<vector<int>> graph;
int city[MAXN], marked[MAXN], sz[MAXN], vis[MAXN], cVis[MAXN];
vector<int> seen, v[MAXN];
queue<int> q;
int get_sz(int node, int parent) {
sz[node] = 1;
for (auto u : graph[node]) {
if (u == parent || marked[u])
continue;
sz[node] += get_sz(u, node);
}
return sz[node];
}
int find_centro(int node, int parent, int n) {
for (auto u : graph[node]) {
if (u != parent && !marked[u] && sz[u] * 2 >= n)
return find_centro(u, node, n);
# | 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... |