# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
786817 | SalihSahin | Addk (eJOI21_addk) | C++14 | 370 ms | 17380 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>
#define pb push_back
#define fastio cin.tie(0); ios_base::sync_with_stdio(false);
#define int long long
using namespace std;
const int N = 1e5 + 5;
const int mod = 1e9+7;
const int inf = 3e18 + 5;
struct SegmentTree{
vector<int> tree;
void init(int n){
tree.resize(n*4);
}
void build(vector<int> &a, int v, int l, int r){
if(l == r) tree[v] = a[l];
else{
int m = (l + r)/2;
build(a, v*2, l, m);
build(a, v*2+1, m+1, r);
tree[v] = tree[v*2] + tree[v*2+1];
}
}
int query(int v, int l, int r, int tl, int tr){
if(l > r || r < tl || l > tr) return 0;
if(tl <= l && tr >= r) return tree[v];
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... |