# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
835116 | Denkata | Regions (IOI09_regions) | C++17 | 4173 ms | 27420 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 crit = 450;
const int maxn = 2e5+3;
const int maxr = 25003;
int i,j,p,q,n,m,R,Q,k,tin[maxn],tout[maxn],br,cnt[crit+3][maxr],hora[maxn],type[maxn],cur,d,nom[maxn];
vector <int> v[maxn];
vector <int> vid[maxr];
vector <int> kraishta[maxr];
void dfs(int u)
{
tin[u]=++br;
for(auto i:v[u])
dfs(i);
tout[u]=++br;
kraishta[type[u]].push_back(tin[u]);
}
void dfs2(int u)
{
cnt[nom[i]][type[u]]+=cur;
if(type[u]==i)
cur++;
for(auto j:v[u])
dfs2(j);
if(type[u]==i)
cur--;
}
int calc()
{
int ans = 0;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |