# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
650808 | jasen_penchev | ČVENK (COI15_cvenk) | C++14 | 605 ms | 2952 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 <iostream>
#include <utility>
#include <random>
#define endl '\n'
#define fi first
#define se second
using namespace std;
mt19937 rg(4209008);
const int MAXN = 100000;
const int LOG = 34;
int n;
pair<int, int> p[MAXN + 5];
pair<int, int> kth_ancestor(int x, int y, long long k)
{
if (k == 0) return make_pair(x, y);
if (x == 0) return make_pair(x, y - k);
if (y == 0) return make_pair(x - k, y);
int bx = (x & (-x)), by = (y & (-y));
if (bx < by) return kth_ancestor(x - min(1ll * bx, k), y, k - min(1ll * bx, k));
else return kth_ancestor(x, y - min(1ll * by, k), k - min(1ll * by, k));
}
long long depth(pair<int, int> x)
{
return (1ll * x.fi + 1ll * x.se);
# | 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... |