# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
7251 | Rhak | Game (IOI13_game) | C++98 | 11264 ms | 256000 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 "game.h"
#include<stdio.h>
long long gcd2(long long x, long long y){ return y==0? x: gcd2(y, x%y); }
struct _node{
_node *d[4];
long long GCD;
_node(long long GCD):GCD(GCD){ d[0] = d[1] = d[2] = d[3] = 0; }
};
struct _IndexTree{
int S, E;
_node *root;
_IndexTree(int S,int E):S(S), E(E){ root = new _node(0);}
void update(_node* n, int s, int e, int p, long long N, _IndexTree** arr)
{
if( p < s || e < p) return;
else if( p == s && e == p){
if( N != -1) n->GCD = N;
else{
long long fn = 0;
for(int i = 0; i < 3; i++){
if(arr[i]) fn = gcd2(fn, arr[i]->read(s,e));
}
n->GCD = fn;
}
return;
}
long long t[4] = {0}, fn = 0;
# | 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... |