# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
216922 | JustasZ | Capital City (JOI20_capital_city) | C++14 | 1162 ms | 34520 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.
/*input
*/
#include <bits/stdc++.h>
#define pb push_back
#define x first
#define y second
#define all(a) a.begin(), a.end()
#define sz(a) (int)a.size()
#define rd() abs((int)rng())
using namespace std;
using ll = long long;
using ld = long double;
using pii = pair<int, int>;
const int maxn = 2e5 + 100;
const int mod = 1e9 + 7;
mt19937 rng(chrono::high_resolution_clock::now().time_since_epoch().count());
int n, k, color[maxn], vis[maxn], par[maxn], par2[maxn], sub[maxn], color_added[maxn], color_id[maxn], color_cnt[maxn], color_total[maxn];
vector<int>byColor[maxn];
vector<int>colors;
vector<int>adj[maxn];
void dfs(int v) {
sub[v] = 1;
for (int to : adj[v]) {
if (!vis[to] && to != par[v]) {
par[to] = v;
dfs(to);
sub[v] += sub[to];
}
}
}
# | 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... |