# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
118211 | nvmdava | Tropical Garden (IOI11_garden) | C++17 | 2937 ms | 9192 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"
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
using namespace std;
int n, p;
int to[300005];
int best[150005][2];
bool proc[300005][2];
int cyc[2];
int t[300005][2];
void dfs1(int v){
if(proc[v][0]) return;
proc[v][0] = 1;
if(v == p) return;
dfs1(to[v]);
t[v][0] = t[to[v]][0] + 1;
}
void dfs0(int v){
if(proc[v][1]) return;
proc[v][1] = 1;
if(v == p + n) return;
dfs0(to[v]);
t[v][1] = t[to[v]][1] + 1;
}
void count_routes(int n, int m, int p, int r[][2], int q, int g[]){
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |