# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
553749 | QwertyPi | Distributing Candies (IOI21_candies) | C++17 | 347 ms | 39352 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 fi first
#define se second
using namespace std;
typedef pair<int, int> pii;
typedef long long ll;
const int N = 2e5+5;
const ll inf = 1LL << 60;
vector<int> L, R, V;
int q;
int bound(int l, int r, int x){
if(x < l) return l;
if(x > r) return r;
return x;
}
namespace Segtree{
struct node{
ll mxp = 0, mnp = 0, s = 0;
node(){}
node(ll v) : mxp(max(v, 0LL)), mnp(min(v, 0LL)), s(v){};
} t[N * 4];
node merge(node a, node b){
if(a.mxp == inf || b.mxp == inf) return a.mxp == inf ? b : a;
node ret;
ret.mxp = max(a.mxp, a.s + b.mxp);
ret.mnp = min(a.mnp, a.s + b.mnp);
ret.s = a.s + b.s;
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... |