Submission #1066105

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
10661052024-08-19 15:05:50sammyuriFoehn Phenomena (JOI17_foehn_phenomena)C++17
100 / 100
692 ms18260 KiB
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MAXN = (1 << 18);
ll tree[2 * MAXN], lazy[2 * MAXN];
void init() {
for (int i = 0; i < 2 * MAXN; i ++)
tree[i] = lazy[i] = 0;
}
void pushdown(int index) {
if (lazy[index] != 0) {
if (index < MAXN) {
lazy[2 * index] += lazy[index];
lazy[2 * index + 1] += lazy[index];
tree[index] = tree[2 * index] + tree[2 * index + 1] + lazy[index];
} else {
tree[index] += lazy[index];
}
lazy[index] = 0;
}
}
void upd(int left, int right, int index, int maxl, int maxr, ll value) {
if (left == maxl && right == maxr) {
lazy[index] += value; return;
}
pushdown(index);
int mid = (maxl + maxr) / 2;
if (left <= mid)
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...