# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
895436 | MinaRagy06 | Regions (IOI09_regions) | C++17 | 4443 ms | 74000 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#define ll long long
const int N = 200'005, inf = 1e9 + 5;
vector<int> adj[N];
int a[N], p[N], sz[N], order[N], idx[N];
vector<int> above[N], below[N], gud[N];
void calc1(int i, int c, int r) {
above[r][a[i]] += c;
above[r][a[i]] = min(above[r][a[i]], inf);
c += a[i] == order[r];
for (auto nxt : adj[i]) {
calc1(nxt, c, r);
}
}
int calc2(int i, int r) {
int c = 0;
for (auto nxt : adj[i]) {
c += calc2(nxt, r);
}
below[r][a[i]] += c;
below[r][a[i]] = min(below[r][a[i]], inf);
return c + (a[i] == order[r]);
}
int st[N], en[N], t;
void dfs(int i) {
st[i] = t++;
for (auto nxt : adj[i]) {
dfs(nxt);
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |