# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
361610 | gratus907 | 조화행렬 (KOI18_matrix) | C++17 | 0 ms | 0 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>
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#define ll long long
#define int ll
#define eps 1e-7
#define all(x) ((x).begin()),((x).end())
#define usecppio ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
using namespace std;
const int MAXR = 1000000007;
const int MAXC = 1000000007;
// max-dynamic-2seg
// msg555 impl, some modifications
void init(int32_t R, int32_t C) {}
int agg(int a, int b) {return __gcd(a, b);}
struct Dynamic2DSeg
{
struct Node
{
Node (int l, int r, int v = 0) : l(l), r(r), v(v), lc(NULL), rc(NULL){}
int l, r, v;
Node *lc, *rc;
};
struct RowNode
{
RowNode () : lc(NULL), rc(NULL), rowRoot(0, MAXC){}
Node rowRoot;
RowNode *lc, *rc;