# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
681584 | puppy | Regions (IOI09_regions) | C++17 | 4436 ms | 86964 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 <iostream>
#include <vector>
#include <utility>
#include <map>
#include <cmath>
#include <algorithm>
using namespace std;
int N, SQ;
int R, Q;
int cnt[25005];
int cpx[25005];
int region[200005], par[200005];
int s[200005], e[200005];
int dp[200005][75];
vector<int> g[200005];
vector<int> exceed;
vector<int> ett;
void dfs(int v)
{
s[v] = (int)ett.size() + 1;
ett.push_back(v);
for (auto &i:g[v]) dfs(i);
e[v] = (int)ett.size() - 1;
}
void dfs2(int v, int p)
{
int loc = -1;
if (cnt[region[v]] > 8 * SQ) loc = cpx[region[v]];
for (int i = 0; i < (int)exceed.size(); i++) {
dp[v][i] = dp[p][i] + (i == loc);
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |