# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
837183 | QwertyPi | Distributing Candies (IOI21_candies) | C++17 | 316 ms | 44476 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>
#define int long long
using namespace std;
const int N_MAX = 2e5 + 11;
int n, q;
struct node{
int pref_max, pref_min, sum;
node() : pref_max(0), pref_min(0), sum(0){}
node(int v) : pref_max(max(0LL, v)), pref_min(min(0LL, v)), sum(v){};
};
struct update{
int t, pos, val;
};
node operator+ (const node& a, const node& b){
node res;
res.pref_max = max(a.pref_max, a.sum + b.pref_max);
res.pref_min = min(a.pref_min, a.sum + b.pref_min);
res.sum = a.sum + b.sum;
return res;
}
node t[N_MAX << 2];
int a[N_MAX];
# | 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... |