# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
581611 | JovanB | Santa Claus (RMI19_santa) | C++17 | 250 ms | 13252 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>
using namespace std;
using ll = long long;
using ld = long double;
const int N = 100000;
struct Segment{
int mn, sum;
} seg[4*N+5];
void mrg(int node){
seg[node].sum = seg[node*2].sum + seg[node*2+1].sum;
seg[node].mn = min(seg[node*2].mn, seg[node*2].sum + seg[node*2+1].mn);
}
void init(int node, int l, int r){
seg[node].mn = seg[node].sum = 0;
if(l == r) return;
int mid = (l+r)/2;
init(node*2, l, mid);
init(node*2+1, mid+1, r);
}
void upd(int node, int l, int r, int x, int t){
if(l == r){
seg[node].mn += t;
seg[node].sum += t;
return;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |