# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
378843 | 8e7 | Regions (IOI09_regions) | C++14 | 6121 ms | 30060 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.
//Challenge: Accepted
#include <iostream>
#include <algorithm>
#include <utility>
#include <vector>
#define ll long long
#define maxn 200005
#define maxc 25005
#define pii pair<ll, ll>
#define ff first
#define ss second
#define io ios_base::sync_with_stdio(0);cin.tie(0);
using namespace std;
const int siz = 128;
vector<int> adj[maxn], pos[maxc], node[maxc];
int col[maxn], cnt[maxc], ind[1000], cor[maxc];
int ans[505][maxc], lef[maxn], rig[maxn];
int cur = 0, num = 0, c = 0;
void dfs(int n, int par) {
lef[n] = c++;
ans[cur][col[n]] += num;
if (col[n] == ind[cur]) num++;
for (int v:adj[n]) {
if (v != par) {
dfs(v, n);
}
}
rig[n] = c;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |