# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1076417 | ArthuroWich | Tropical Garden (IOI11_garden) | C++17 | 1363 ms | 76276 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 "garden.h"
#include "gardenlib.h"
#include<bits/stdc++.h>
using namespace std;
int n, m, p, ans = 0;
vector<int> adj[150005], radj[300005];
int succ[300005][31], vis1[300005], vis2[300005], dep1[300005], dep2[300005], cyc1 = -1, cyc2 = -1;
void initsucc() {
for (int j = 1; j < 31; j++) {
for (int i = 0; i <= 2*n; i++) {
succ[i][j] = succ[succ[i][j-1]][j-1];
}
}
}
void calc(int a, int k) {
for (int i = 0; i < 31; i++) {
if (k & (1 << i)) {
a = succ[a][i];
}
}
if (a == p || a == p+n) {
ans++;
}
}
void dfs1(int i, int st, int d) {
if (vis1[i] && st == i && cyc1 == -1) {
cyc1 = d;
return;
}
if (vis1[i]) {
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |