# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
597763 | idiot123 | Distributing Candies (IOI21_candies) | C++17 | 630 ms | 42948 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<bits/stdc++.h>
#include "candies.h"
using namespace std;
const long long INF = 1e18;
class Tree{
private:
int lrSize = 2;
vector<long long> maxVal;
vector<long long> minVal;
vector<long long> lazy;
void update(int pos, bool up){
minVal[pos] = min(minVal[2*pos], minVal[2*pos+1]);
maxVal[pos] = max(maxVal[2*pos], maxVal[2*pos+1]);
if(pos > 1 && up)update(pos/2, true);
}
void push(int pos){
minVal[2*pos] += lazy[pos];
maxVal[2*pos] += lazy[pos];
lazy[2*pos] += lazy[pos];
minVal[2*pos + 1] += lazy[pos];
maxVal[2*pos + 1] += lazy[pos];
lazy[2*pos + 1] += lazy[pos];
lazy[pos] = 0;
}
# | 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... |