# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
491983 | ponytail | Distributing Candies (IOI21_candies) | C++17 | 1296 ms | 139196 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.
//To be submitted - START
#include "candies.h"
#include <bits/stdc++.h>
#include <vector>
using namespace std;
std::vector<int> distribute_candies(std::vector<int> c, std::vector<int> l,
std::vector<int> r, std::vector<int> v);
//Segment tree beats: version 2
//range min-with, range max-with, range add, range sum
struct segtree_beats {
bool cmp(__int128 x, __int128 y) { return x > y; }
int stok;
const __int128 extr = 2e18;
struct node {
__int128 max1, max2, maxc;
__int128 min1, min2, minc;
__int128 lazy, sum;
__int128 l, r;
};
vector<node> a;
void pushtag_max(int idx, __int128 val) {
if(val >= a[idx].max1) return;
a[idx].sum -= (a[idx].max1 - val) * a[idx].maxc;
a[idx].max1 = val;
if(a[idx].l == a[idx].r) {
a[idx].min1 = val;
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... |