# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
766555 | caganyanmaz | Catfish Farm (IOI22_fish) | C++17 | 0 ms | 0 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>
#define pb push_back
using namespace std;
//#define DEBUGGING
#ifdef DEBUGGING
#define debug(x) cout << (#x) << ": " << (x) << endl;
#else
#define debug(x)
#endif
struct Node
{
int head, tail, size, nxt, move_sum, max_node;
Node(int index) : head(index), tail(index), size(1), nxt(-1), move_sum(0), max_node(-1) {}
Node() : Node(-1) {}
};
constexpr static int MXSIZE = 2e5;
constexpr static int MXLOG = 20;
int v[MXSIZE];
array<int,2> sv[MXSIZE];
vector<int> g[MXSIZE];
int bl[MXSIZE][MXLOG];
int depth[MXSIZE];
Node node[MXSIZE];
void dfs(int node, int parent, int d);
void process_bl(int n);
int advance(int node, int steps);