제출 #94091

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
940912019-01-15 23:23:54tincamateiBubble Sort 2 (JOI18_bubblesort2)C++14
0 / 100
6 ms1144 KiB
#include <bits/stdc++.h>
#include "bubblesort2.h"
using namespace std;
const int MAX_N = 8000;
vector<int> a;
int maxpref[MAX_N], minsuff[MAX_N];
int badsegtree[MAX_N];
void update(int poz, int val, int n) {
maxpref[0] = a[0];
for(int i = 1; i < n; ++i)
maxpref[i] = max(maxpref[i - 1], a[i]);
minsuff[n - 1] = a[n - 1];
for(int i = n - 2; i >= 0; --i)
minsuff[i] = min(minsuff[i + 1], a[i]);
for(int i = 0; i < poz; ++i)
if(maxpref[i] > a[poz])
badsegtree[i] += val;
for(int i = poz; i < n - 1; ++i)
if(a[poz] > minsuff[i])
badsegtree[i] += val;
}
int getInv(int 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...