# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
293343 | Plurm | Regions (IOI09_regions) | C++11 | 5546 ms | 117588 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 K = 2000;
vector<int> sp; // special regions
vector<int> bckt[25005];
int h[200005];
int s[200005];
int stat[200005][200005/K+10];
int cnt[200005]; // how many parents with i-th region
vector<int> g[200005];
int prec[200005/K+10][25005]; // prec[i][j] -> how the i-th special regions manage ones from j-th region
vector<int> et;
vector<int> etbckt[25005];
int st[200005];
int ft[200005];
void dfs(int u){
st[u] = et.size();
etbckt[h[u]].push_back(et.size());
et.push_back(u);
for(int i = 0; i < sp.size(); i++){
stat[u][i] = cnt[sp[i]];
}
cnt[h[u]]++;
for(int v : g[u]){
dfs(v);
}
cnt[h[u]]--;
ft[u] = et.size();
}
int query(int r1, int r2){
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |