# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
435171 | ecnerwala | 사탕 분배 (IOI21_candies) | C++17 | 516 ms | 34156 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "candies.h"
#include <bits/stdc++.h>
std::vector<int> distribute_candies(
std::vector<int> C,
std::vector<int> L,
std::vector<int> R,
std::vector<int> V
) {
struct range_data {
int64_t pref_min, pref_max, tot_val;
bool incr;
explicit range_data(int v = 0) {
pref_min = std::min(0, v);
pref_max = std::max(0, v);
tot_val = v;
incr = (v >= 0);
}
range_data(range_data a, range_data b) {
pref_min = std::min(a.pref_min, a.tot_val + b.pref_min);
pref_max = std::max(a.pref_max, a.tot_val + b.pref_max);
tot_val = a.tot_val + b.tot_val;
incr = a.incr;
}
int64_t range() const {
return pref_max - pref_min;
}
# | 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... |