# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
317365 | tushar_2658 | Regions (IOI09_regions) | C++14 | 6193 ms | 45728 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 maxn = 200005;
using ll = long long;
vector<int> edges[maxn];
int a[maxn];
int magic = 320;
vector<int> nodes[maxn];
ll ans[2 + (200000 / 320)][25005];
int cur, node = 0, id[maxn];
void dfs(int x, int p, ll cnt){
if(a[x] == cur)++cnt;
else {
ans[id[cur]][a[x]] += cnt;
}
for(auto i : edges[x]){
if(i != p){
dfs(i, x, cnt);
}
}
}
int st[maxn], ed[maxn], vert[maxn], timer = 0;
void calc(int x, int p){
st[x] = ++timer;
vert[timer] = x;
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |