# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
51480 | Vinhspm | Foehn Phenomena (JOI17_foehn_phenomena) | C++14 | 6 ms | 700 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;
#define ll long long
#define ii pair<int, int>
#define fi first
#define se second
#define pb push_back
const int N = 2009;
const int oo = 1e9;
const int mod = 1e9 + 7;
int n, q, de, inc, sum;
int node[N], la[4*N];
void true_val(int i, int l, int r) {
if(l > r || !la[i]) return;
if(l == r) node[l] += la[i];
else {
la[2*i] += la[i];
la[2*i + 1] += la[i];
}
la[i] = 0;
}
void update(int i, int l, int r, int a, int b, int val) {
true_val(i, l, r);
if(l > r || r < a || l > b) return;
if(a <= l && r <= b) {
la[i] += val;
return;
}
int mid = (l + r) / 2;
update(2*i, l, mid, a, b, val); update(2*i + 1, mid + 1, r, a, b, val);
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |