# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
465383 | koioi.org-dennisstar | 사탕 분배 (IOI21_candies) | C++17 | 464 ms | 36972 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "candies.h"
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int MX = 1<<19;
vector<ll> smx(MX), smn(MX), st(MX);
void upd(int i, int s, int e, int t, ll v) {
if (s==e) {
smx[i]=max(0ll, v);
smn[i]=min(0ll, v);
st[i]=v;
return ;
}
int m=(s+e)/2;
if (t<=m) upd(i*2, s, m, t, v);
else upd(i*2+1, m+1, e, t, v);
st[i]=st[i*2]+st[i*2+1];
smx[i]=max(smx[i*2], st[i*2]+smx[i*2+1]);
smn[i]=min(smn[i*2], st[i*2]+smn[i*2+1]);
}
ll get(int i, int s, int e, ll c) {
if (s==e) return min(max(st[i], 0ll), c);
# | 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... |