# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
471281 | CSQ31 | Game (IOI13_game) | C++17 | 3352 ms | 72732 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 <bits/stdc++.h>
using namespace std;
typedef long long int ll;
int r,c;
ll gcd2(ll a,ll b){if(!b)return a;else if(!a)return b;else return gcd2(b,a%b);}
struct node{
node *L = NULL,*R = NULL;
int l,r;
ll val = 0;
node(){}
node(int _l,int _r):l(_l),r(_r){}
void upd(int x,ll v){
if(l == r){val = v;return;}
int mid = (l+r)/2;
node *& tp = (x<=mid?L : R);
if(tp == NULL){
tp = new node(x,x);
tp->val = v;
}else if(tp->l<=x && x<=tp->r)tp->upd(x,v);
else{
//we want to find the ancestor of this node and x
int low = l;
int high = r;
while((x<=mid) == (tp->l <= mid)){
if(x<=mid)high = mid;
else low = mid+1;
mid = (high+low)/2;
}
node * nn = new node(low,high);
# | 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... |