# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
666426 | Melika0gh | Regions (IOI09_regions) | C++17 | 4157 ms | 72516 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 = 2e5 + 10, maxr = 25e3, maxsq = 500;
int st[maxn], ft[maxn], pnt[maxn], cnt_big[maxsq + 10], cnt[maxsq + 10][maxr], h[maxn];
vector<int> tmp_team[maxr], team[maxr];
vector<int> adj[maxn];
int n, q, r, t;
void Dfs(int v, int p)
{
st[v] = t++;
if(pnt[h[v]] > 0)
cnt_big[pnt[h[v]]]++;
team[h[v]].push_back(st[v]);
for(int u : adj[v])
{
for(int i = 1; i < maxsq + 10; i++)
cnt[i][h[u]] += cnt_big[i];
Dfs(u, v);
}
if(pnt[h[v]] > 0)
cnt_big[pnt[h[v]]]--;
ft[v] = t;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |