Submission #528135

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
5281352022-02-19 11:13:26HappyPacManComparing Plants (IOI20_plants)C++14
5 / 100
1363 ms72508 KiB
#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;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...