# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
531138 | fabijan_cikac | Addk (eJOI21_addk) | C++17 | 81 ms | 4104 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 <iostream>
#include <vector>>
using namespace std;
#define ll long long int
#define F first
#define S second
#define pll pair<ll, ll>
const int N = 1e5 + 10;
int n, k, q;
ll a[N]; pll fen[N];
void update(int x, ll val){
a[x] += val; ++x; int y = x;
while (x <= n){
fen[x] = {fen[x].F + val, fen[x].S + y * val}; x += x & (-x);
}
}
pll query(int x){
++x; pll val = {0, 0};
while (x > 0){
val = {val.F + fen[x].F, val.S + fen[x].S}; x -= x & (-x);
}
return val;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |