# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
485087 | wwdd | Distributing Candies (IOI21_candies) | C++17 | 793 ms | 37104 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 <vector>
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef pair<ll,ll> pl;
// bruh
class ST {
private:
int n,h;
vl sa,sb,lz;
const ll STA = -1LL<<62;
const ll STB = 1LL<<62;
int log2(int v) {
if(v <= 1) return 1;
return log2(v/2)+1;
}
void ap(int p, ll val) {
sa[p] += val;
sb[p] += val;
if(p < n) {lz[p] += val;}
}
void build(int p) {
while(p > 1) {
p >>= 1;
if(p >= n) continue;
sa[p] = max(sa[p<<1],sa[p<<1|1])+lz[p];
sb[p] = min(sb[p<<1],sb[p<<1|1])+lz[p];
# | 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... |