제출 #719699

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
7196992023-04-06 13:52:23ArturgoMeasures (CEOI22_measures)C++14
100 / 100
529 ms22000 KiB
#include <bits/stdc++.h>
#define int long long
using namespace std;
const int INFINI = 1000 * 1000 * 1000;
int nbInitiaux, nbAjouts, dist;
int ajouts[(1 << 20)];
int mins[(1 << 20)];
int maxs[(1 << 20)];
int deltas[(1 << 20)];
bool est_active[(1 << 20)];
void update(int n) {
est_active[n] = est_active[2 * n] || est_active[2 * n + 1];
if(!est_active[n]) return;
maxs[n] = -INFINI + ajouts[n];
mins[n] = INFINI + ajouts[n];
if(est_active[2 * n]) {
mins[n] = min(mins[n], mins[2 * n] + ajouts[n]);
maxs[n] = max(maxs[n], maxs[2 * n] + ajouts[n]);
}
if(est_active[2 * n + 1]) {
mins[n] = min(mins[n], mins[2 * n + 1] + ajouts[n]);
maxs[n] = max(maxs[n], maxs[2 * n + 1] + ajouts[n]);
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
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...