# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
715929 | tengiz05 | Rabbit Carrot (LMIO19_triusis) | C++17 | 314 ms | 21504 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using i64 = long long;
constexpr int inf = 1001111111;
struct SegmentTree {
int n;
std::vector<i64> mn, mn2, lazy;
SegmentTree(int n) : n(n), mn(4 * n, -inf), mn2(4 * n, inf), lazy(4 * n) {}
void push(int p) {
mn[2 * p] += lazy[p];
mn[2 * p + 1] += lazy[p];
mn2[2 * p] += lazy[p];
mn2[2 * p + 1] += lazy[p];
mn[2 * p] = std::max(mn[2 * p], mn[p]);
mn[2 * p + 1] = std::max(mn[2 * p + 1], mn[p]);
lazy[2 * p] += lazy[p];
lazy[2 * p + 1] += lazy[p];
lazy[p] = 0;
}
void pull(int p) {
mn[p] = std::min(mn[2 * p], mn[2 * p + 1]);
if (mn[2 * p] == mn[2 * p + 1]) {
mn2[p] = std::min(mn2[2 * p], mn2[2 * p + 1]);
} else if (mn[2 * p] == mn[p]) {
mn2[p] = std::min(mn2[2 * p], mn[2 * p + 1]);
} else {
mn2[p] = std::min(mn[2 * p], mn2[2 * p + 1]);
}
# | 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... |