# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
507676 | ITO | Distributing Candies (IOI21_candies) | C++17 | 533 ms | 23500 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "candies.h"
#include <bits/stdc++.h>
using namespace std;
int n, smax[800001], smin[800001], scur[800001], scap[800001], cc[200001], inf = 2000000001;
vector<int> s;
int mincap(int id, int l, int r, int ll, int rr) {
if (l > rr || r < ll) return l;
if (l <= ll && r >= rr) return scap[id];
int mid = (ll + rr) / 2, x1 = mincap(id * 2, l, r, ll, mid), x2 = mincap(id * 2 + 1, l, r, mid + 1, rr);
if (cc[x1] < cc[x2]) return x1;
return x2;
}
void updcap(int id, int lr, int ll, int rr) {
if (ll == rr) {
scap[id] = lr;
return;
}
int mid = (ll + rr) / 2;
if (lr <= mid) {
updcap(id * 2, lr, ll, mid);
} else {
updcap(id * 2 + 1, lr, mid + 1, rr);
}
if (cc[scap[id * 2]] < cc[scap[id * 2 + 1]]) {
scap[id] = scap[id * 2];
} else {
scap[id] = scap[id * 2 + 1];
}
return;
# | 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... |