# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
518360 | Alex_tz307 | Regions (IOI09_regions) | C++17 | 2587 ms | 35748 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;
const int kN = 2e5;
const int kR = 25 * 1e3;
const int kBuck = 450;
int timer, r[kN], in[kN], out[kN], ind[kR], cnt[kBuck], sum[1 + kN], root1[kBuck][kR], root2[kBuck][kR];
vector<int> large, g[kN], R[kR];
bitset<kN> isLarge;
vector<pair<int, int>> subtrees[kR];
vector<int> nodes[kR];
void dfs(int u) {
in[u] = ++timer;
for (int region : large) {
root1[ind[region]][r[u]] += cnt[ind[region]];
}
if (isLarge[r[u]]) {
++cnt[ind[r[u]]];
}
for (int v : g[u]) {
dfs(v);
}
if (isLarge[r[u]]) {
--cnt[ind[r[u]]];
}
out[u] = timer;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |