# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
728619 | piOOE | 푸드 코트 (JOI21_foodcourt) | C++17 | 418 ms | 53496 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
namespace SegmentTree {
constexpr int N = 1 << 18;
array<ll, 2> t[N * 2];
array<ll, 2> operator+(const array<ll, 2> &a, const array<ll, 2> &b) {
return {a[0] + b[0], max(b[1], a[1] + b[0])};
}
void pull(int x) {
t[x] = t[x << 1] + t[x << 1 | 1];
}
void modify(int x, ll v) {
x += N;
t[x][0] = v, t[x][1] = max(0LL, v);
while (x >>= 1) {
pull(x);
}
}
array<ll, 2> rangeQuery(int l, int r) {
array<ll, 2> L{}, R{};
for (l += N, r += N; l < r; r >>= 1, l >>= 1) {
if (l & 1) {
L = L + t[l++];
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |