제출 #650227

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
6502272022-10-13 00:54:57czhang2718Tenis (COI19_tenis)C++17
100 / 100
182 ms7824 KiB
#include "bits/stdc++.h"
using namespace std;
const int N=1e5;
int n, q;
int p[3][N];
int ind[3][N];
int mn[4*N];
int lazy[4*N];
void push(int x, int lx, int rx){
if(rx-lx==1 || !lazy[x]) return;
mn[2*x+1]+=lazy[x];
mn[2*x+2]+=lazy[x];
lazy[2*x+1]+=lazy[x];
lazy[2*x+2]+=lazy[x];
lazy[x]=0;
}
void upd(int i, int v, int x, int lx, int rx){
push(x, lx, rx);
if(rx<=i) return;
if(lx>=i){
mn[x]+=v;
lazy[x]+=v;
return;
}
int m=(lx+rx)/2;
upd(i, v, 2*x+1, lx, m);
upd(i, v, 2*x+2, m, rx);
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
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...