Submission #441185

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
4411852021-07-04 13:52:44peijarBubble Sort 2 (JOI18_bubblesort2)C++17
100 / 100
4003 ms189776 KiB
#include "bubblesort2.h"
#include <bits/stdc++.h>
using namespace std;
const int MAXN = (1 << 21) + 1;
int iDeb[MAXN], iFin[MAXN], maxVal[MAXN], lazyAdd[MAXN];
set<int> ids[MAXN];
int curDelta[MAXN];
void pull(int iNoeud) {
maxVal[iNoeud] = max(maxVal[2 * iNoeud], maxVal[2 * iNoeud + 1]);
}
void push(int iNoeud) {
if (!lazyAdd[iNoeud])
return;
maxVal[iNoeud] += lazyAdd[iNoeud];
if (iDeb[iNoeud] < iFin[iNoeud]) {
lazyAdd[2 * iNoeud] += lazyAdd[iNoeud];
lazyAdd[1 + 2 * iNoeud] += lazyAdd[iNoeud];
} else {
curDelta[iDeb[iNoeud]] += lazyAdd[iNoeud];
}
lazyAdd[iNoeud] = 0;
}
void buildTree(int iNoeud, int deb, int fin) {
iDeb[iNoeud] = deb, iFin[iNoeud] = fin;
maxVal[iNoeud] = -1e9;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
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...