# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
298439 | pit4h | Amusement Park (JOI17_amusement_park) | C++14 | 219 ms | 23000 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 "Joi.h"
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
const int _B = 60;
void build_tree(int x, vector<vector<int>>& g, vector<bool>& vis, vector<vector<int>>& G) {
vis[x] = 1;
for(int i: g[x]) {
if(!vis[i]) {
G[x].push_back(i);
G[i].push_back(x);
build_tree(i, g, vis, G);
}
}
}
struct Nodes {
int key, val, par;
};
void dfs(int x, int p, vector<vector<int>>& g, int& counter, vector<vector<Nodes>>& T, vector<int>& rep) {
if(counter<_B) {
T[0].push_back({x, counter, p});
rep[x] = 0;
}
else {
rep[x] = T.size();
T.push_back(T[rep[p]]);
map<int, bool> has_child;
for(auto it: T[rep[x]]) {
has_child[it.par] = 1;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |