# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
140672 | khrbuddy03 | 공장 (KOI13_factory) | C++14 | 555 ms | 28780 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 siz = 5e5 + 9;
struct seg {
lint tree[siz * 4];
seg() {
fill(&tree[0], &tree[siz * 4], 0LL);
}
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) * 1LL;
}
lint update(int idx, int val, int node, int low, int high) {
if (idx < low || high < idx) return tree[node] * 1LL;
if (low == high) return tree[node] = val * 1LL;
int mid = (low + high) / 2;
return tree[node] = update(idx, val, node * 2, low, mid) * 1LL + update(idx, val, node * 2 + 1, mid + 1, high) * 1LL;
}
} seg;
int A[(int)1e6 + 9], B[siz];
int main() {
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |