# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
53638 | baactree | Regions (IOI09_regions) | C++17 | 7684 ms | 127056 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;
int n, r, q;
vector<int> adj[200005];
int arr[200005];
const int sz = 1000;
int cache[sz][25005];
pair<int, int> cnt[25005];
int inv[25005];
int le[200005], ri[200005];
vector<int> lv[25005], rv[25005];
vector<int> vec[25005];
int vn;
void dfs(int now, int par) {
vec[arr[now]].push_back(now);
le[now] = vn++;
lv[arr[now]].push_back(le[now]);
for (auto &there : adj[now]) {
if (there == par)continue;
dfs(there, now);
}
ri[now] = vn++;
rv[arr[now]].push_back(ri[now]);
}
int main() {
scanf("%d%d%d", &n, &r, &q);
scanf("%d", &arr[1]);
cnt[arr[1]].first++;
for (int i = 2; i <= n; i++) {
int a, b;
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |