# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
372263 | gustason | Travels (LMIO17_keliones) | C++11 | 291 ms | 20716 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;
using ll = long long;
#define int ll
const int mod = 1e9 + 7;
struct SegmentTree {
vector<ll> tree;
int n;
SegmentTree(vector<int>& a) {
n = a.size();
tree.assign(2*n, 0);
for(int i = n; i < 2*n; i++) {
tree[i] = a[i-n];
}
for(int idx = n-1; idx > 0; idx--) {
tree[idx] = tree[2*idx] + tree[2*idx+1];
}
}
void update(int idx, ll val) {
idx += n;
tree[idx] = val;
while(idx > 1) {
idx /= 2;
tree[idx] = tree[2*idx] + tree[2*idx+1];
tree[idx] %= mod;
}
}
ll getSum(int L, int 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... |