# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1126597 | VinhLuu | Distributing Candies (IOI21_candies) | C++20 | 350 ms | 43784 KiB |
#include <bits/stdc++.h>
//#define ll long long
#define ll long long
#define all(lpv) lpv.begin(), lpv.end()
#define pot(x, y) lower_bound(x.begin(), x.end(), y) - x.begin() + 1
using namespace std;
//#define lpv
#ifndef lpv
#include "candies.h"
#endif // lpv
typedef pair<ll,ll> pii;
const ll N = 2e5 + 5;
ll n, q, h[N], a[N], L[N], R[N], C[N], mi[N << 2], mx[N << 2], lz[N << 2], st[N << 2];
vector<ll> open[N], _close[N];
void update(ll i,ll l,ll r,ll u,ll x) {
if(l > r || r < u || u < l) return;
if(l == r) {
st[i] = x;
mx[i] = max(0ll, x);
mi[i] = min(0ll, x);
return;
}
ll mid = (l + r) / 2;
update(i << 1, l, mid, u, x);
update(i << 1|1, mid + 1, r, u, x);
Compilation message (stderr)
# | 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... |