# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1003670 | AdamGS | Amusement Park (JOI17_amusement_park) | C++17 | 15 ms | 4416 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;
typedef long long ll;
#define rep(a, b) for(int a = 0; a < (b); ++a)
#define st first
#define nd second
#define pb push_back
#define all(a) a.begin(), a.end()
const int LIM=1e4+7;
vector<int>V[LIM];
ll F[LIM], odl[LIM], jaki[LIM], pre[LIM], czy[LIM], n, X, akt;
int fnd(int x) {
if(F[x]==x) return x;
return F[x]=fnd(F[x]);
}
bool uni(int a, int b) {
if(fnd(a)==fnd(b)) return false;
F[fnd(b)]=fnd(a);
return true;
}
void DFS(int x, int o) {
pre[x]=akt++;
for(auto i : V[x]) if(i!=o) {
odl[i]=odl[x]+1;
DFS(i, x);
}
}
void DFS2(int x, int o, int k) {
if(x==k) czy[x]=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... |