# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
140673 | khrbuddy03 | XCorr (KOI18_XCorr) | C++14 | 393 ms | 37308 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 lint = long long;
const int inf = (int)1e9 + 9;
const int siz = (int)3e5 + 9;
struct seg {
lint tree[siz * 4];
lint query(int left, int right, int node, int low, int high) {
if (right < low || high < left) return 0LL;
if (left <= low && high <= right) return tree[node] * 1LL;
int mid = (low + high) / 2;
return query(left, right, node * 2, low, mid) * 1LL + query(left, right, node * 2 + 1, mid + 1, high);
}
void update(int idx, int val, int node, int low, int high) {
if (idx < low || high < idx) return;
if (low == high) tree[node] = val * 1LL;
else {
int mid = (low + high) / 2;
update(idx, val, node * 2, low, mid);
update(idx, val, node * 2 + 1, mid + 1, high);
tree[node] = tree[node * 2] * 1LL + tree[node * 2 + 1] * 1LL;
}
}
} seg;
map<int, int> X;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |