# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
543785 | amunduzbaev | New Home (APIO18_new_home) | C++17 | 1373 ms | 1048576 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;
#define ar array
#define pq priority_queue
const int N = 3e5 + 5;
const int M = 1e7 + 5;
const int MX = 1e8 + 5;
struct ST{
multiset<int> tree[M][2];
int f[M][2], last;
ST(){
last = 0;
}
void make(int x){
if(!f[x][0]) f[x][0] = ++last;
if(!f[x][1]) f[x][1] = ++last;
}
void add(int l, int r, int s, int t, int lx = 0, int rx = MX, int x = 0){
if(lx > r || rx < l) return;
if(lx >= l && rx <= r){
if(t == 1){
tree[x][0].insert(s + (lx - l));
//~ tree[x][0] = max(tree[x][0], s + (lx - l));
} else {
tree[x][1].insert(s - (lx - l));
# | 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... |