# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1071837 | ArthuroWich | Regions (IOI09_regions) | C++17 | 8095 ms | 29816 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;
#define int long long int
vector<int> adj[300005], reg[25005];
int st[300005], en[300005], timer = 0;
void dfs(int i, int p) {
st[i] = timer;
timer++;
for (int j : adj[i]) {
if (j == p) {
continue;
}
dfs(j, i);
}
en[i] = timer;
}
void solve() {
int n, r, q;
cin >> n >> r >> q;
for (int i = 1; i <= n; i++) {
int s, h;
if (i == 1) {
cin >> h;
reg[h].push_back(i);
} else {
cin >> s >> h;
reg[h].push_back(i);
adj[s].push_back(i);
adj[i].push_back(s);
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |