# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
518345 | Alex_tz307 | Regions (IOI09_regions) | C++17 | 4497 ms | 31504 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e5;
const int MAXR = 25 * 1e3;
const int BLOCK = 450;
int r[MAXN], timer, in[MAXN], out[MAXN], ind[MAXR], cnt[BLOCK], sum[1 + MAXN + 1], root1[BLOCK][MAXR], root2[BLOCK][MAXR];
vector<int> g[MAXN], R[MAXR], pos[MAXR], large;
bitset<MAXN> isLarge;
void dfs1(int u) {
in[u] = ++timer;
pos[r[u]].emplace_back(in[u]);
for (int v : g[u])
dfs1(v);
out[u] = timer;
}
void dfs2(int u) {
for (auto region : large) {
root1[ind[region]][r[u]] += cnt[ind[region]];
}
if (isLarge[r[u]]) {
++cnt[ind[r[u]]];
}
for (int v : g[u]) {
dfs2(v);
}
if (isLarge[r[u]]) {
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |