# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
671138 | qin | Pyramid Base (IOI08_pyramid_base) | C++14 | 5083 ms | 96352 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>
#define MIN(a,b) (((a)<(b))?(a):(b))
#define MAX(a,b) (((a)>(b))?(a):(b))
using namespace std;
typedef unsigned ll;
int base = 1;
ll inf = 4e09;
struct event{
int y1, y2; ll c;
event(){}
event(int y1, int y2, ll c) : y1(y1), y2(y2), c(c){}
};
struct seg{
vector<ll> t, p;
void init(int n){
while(base < n) base<<=1;
t.resize(base<<1|1);
p.resize(base<<1|1);
} void purge(){for(int i = 1; i <= base<<1; ++i) t[i] = p[i] = 0;};
void add(int i, ll ile){t[i] += ile, p[i] += ile;}
void push(int i){
add(i<<1, p[i]);
add(i<<1|1, p[i]);
p[i] = 0;
} void update(int i, int pocz, int kon, int x, int y, ll w){
if(x <= pocz && kon <= y) return void(add(i, w));
push(i);
int sr = (pocz+kon) >> 1;
if(x <= sr) update(i<<1, pocz, sr, x, y, w);
if(sr < y) update(i<<1|1, sr+1, kon, x, y, w);
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... |
# | 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... |
# | 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... |