# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
414845 | KoD | Game (IOI13_game) | C++17 | 8599 ms | 54124 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>
#include "game.h"
using ll = long long;
using ull = unsigned long long;
template <class T> using Vec = std::vector<T>;
template <class T> using Box = std::unique_ptr<T>;
ull xorshift() {
static ull val = 7511168;
val ^= val >> 7;
val ^= val << 9;
return val;
}
struct Node;
using Ptr = Box<Node>;
struct Node {
int pos, size;
ull val, gcd;
Ptr left, right;
Node(const int p, const ull v): pos(p), size(1), val(v), gcd(v), left(), right() {}
void fetch() {
size = (left ? left->size : 0) + 1 + (right ? right->size : 0);
gcd = val;
if (left) gcd = std::gcd(gcd, left->gcd);
if (right) gcd = std::gcd(gcd, right->gcd);
}
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... |