# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1166455 | Hanksburger | Game (IOI13_game) | C++20 | 842 ms | 32920 KiB |
#include "game.h"
#include <bits/stdc++.h>
#define ll long long
using namespace std;
struct node
{
node *lc1=0, *rc1=0, *lc2=0, *rc2=0;
int l1=0, r1=1e9, l2=0, r2=1e9;
ll val=0;
} root;
void upd2(node *i, ll x, ll y, ll z)
{
//cout << "upd2 " << i->l1 << ' ' << i->r1 << ' ' << i->l2 << ' ' << i->r2 << '\n';
//if (i->lc1)
// cout << "left child exists\n";
//if (i->rc1)
// cout << "right child exists\n";
if (i->l2==i->r2)
{
if (i->l1==i->r1)
i->val=z;
else
i->val=gcd(i->lc1?i->lc1->val:0, i->rc1?i->rc1->val:0);
//cout << "SEGGGGGGG " << i->l1 << ' ' << i->r1 << ' ' << i->l2 << ' ' << i->r2 << ' ' << i->val << '\n';
return;
}
ll mid=(i->l2+i->r2)/2;
if (y<=mid)
{
if (!i->lc2)
# | 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... |