# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
774758 | cheat_when_I_was_young | Addk (eJOI21_addk) | C++17 | 330 ms | 12496 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.
// #cheat_when_I_was_young
// #cheatkhitacontre #khionhatoicheat
// #thaycuckythatvong
#include "bits/stdc++.h"
using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define int long long
const int NM = 1e6 + 5;
int n, k, q, a[NM], q1[15], tree1[NM<<2], tree2[NM<<2], tree3[NM<<2];
void build1(int *arr, int id = 1, int l = 1, int r = n) {
if (l == r) {
tree1[id] = arr[l];
return;
}
int mid = (l+r) >> 1;
build1(arr, id<<1, l, mid);
build1(arr, id<<1|1, mid+1, r);
tree1[id] = tree1[id<<1] + tree1[id<<1|1];
}
void build2(int *arr, int id = 1, int l = 1, int r = n) {
if (l == r) {
tree2[id] = arr[l] * l;
return;
}
int mid = (l+r) >> 1;
build2(arr, id<<1, l, mid);
build2(arr, id<<1|1, mid+1, r);
tree2[id] = tree2[id<<1] + tree2[id<<1|1];
}
void build3(int *arr, int id = 1, int l = 1, int r = n) {
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |