# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
528135 | HappyPacMan | Comparing Plants (IOI20_plants) | C++14 | 1363 ms | 72508 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 "plants.h"
#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 8;
const int mlog = 20;
const int inf = 1e9;
int N,K,seg[4*maxn],lazy[4*maxn],indexing=0,arr[maxn],rev[maxn],lf[mlog][maxn],sl[mlog][maxn],rg[mlog][maxn],sr[mlog][maxn];
void push(int id){
lazy[id<<1] += lazy[id];
lazy[id<<1|1] += lazy[id];
seg[id<<1] += lazy[id];
seg[id<<1|1] += lazy[id];
lazy[id] = 0;
}
void upd(int id,int tl,int tr,int ul,int ur,int v){
if(tl > tr || ul > tr || ur < tl) return;
if(ul <= tl && tr <= ur){
seg[id] += v;
lazy[id] += v;
return;
}
int tm = (tl+tr)/2;
push(id);
upd(id<<1,tl,tm,ul,ur,v);
upd(id<<1|1,tm+1,tr,ul,ur,v);
seg[id] = min(seg[id<<1],seg[id<<1|1]);
}
int qryfull(int id,int tl,int tr){
if(seg[id] != 0) return -1;
# | 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... |