# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
780695 | Sami_Massah | Sumtree (INOI20_sumtree) | C++17 | 2059 ms | 290284 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>
using namespace std;
const int maxn = 5e5 + 12, maxk = 2e5 + 12, lg = 18, mod = 1e9 + 7;
int n, bs, tz, tms, qsum, h[maxk], col[maxk], sz[maxk], st[maxk], en[maxk], sum1[maxk * 3], sum2[maxk * 3];
long long ans, fact[maxn], rfact[maxn];
set <pair<int, int>> Q[maxk * 3];
vector <int> conn[maxk];
bitset <maxn> marked, zero;
long long tav(long long a, long long b){
if(b == 0)
return 1;
a %= mod;
long long x = tav(a * a % mod, b / 2);
if(b % 2)
return x * a % mod;
return x % mod;
}
void update_tree1(int l, int r, int u, int k, int L = 0, int R = n){
if(r < L || R < l)
return;
if(l <= L && R <= r){
sum1[u] = k;
return;
}
int mid = (L + R) / 2;
update_tree1(l, r, u * 2, k, L, mid);
update_tree1(l, r, u * 2 + 1, k, mid + 1, R);
# | 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... |