# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
264077 | anonymous | Game (IOI13_game) | C++14 | 8000 ms | 43364 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 "game.h"
#define LL long long
#define MAXN 22005
using namespace std;
LL gcd(LL X, LL Y) {
LL tmp;
while (X != Y && Y != 0) {
tmp = X;
X = Y;
Y = tmp % Y;
}
return X;
}
//begin treap
struct Node {
LL GCD, val; //gcd of subtree
int c, pri, l, r; //column, priority, children
};
class TreapForest {
public:
Node trp[MAXN * 125];
int ptr = 1;
void pushup(int t) {
trp[t].GCD = gcd(gcd(trp[trp[t].l].GCD, trp[trp[t].r].GCD), trp[t].val);
}
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... |