# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
297585 | pit4h | Bubble Sort 2 (JOI18_bubblesort2) | C++14 | 9090 ms | 2432 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "bubblesort2.h"
#include<bits/stdc++.h>
using namespace std;
struct Dynamic_segtree {
};
vector<int> countScans(vector<int> a, vector<int> x, vector<int> v){
int q = x.size();
int n = a.size();
vector<int> answer(q);
vector<int> inv(n);
for(int i=0; i<n; ++i) {
for(int j=i+1; j<n; ++j) {
if(a[i] > a[j]) {
inv[j]++;
}
}
}
for(int i=0; i<q; ++i) {
int old = a[x[i]];
a[x[i]] = v[i];
inv[x[i]] = 0;
for(int j=0; j<x[i]; ++j) {
if(a[j] > a[x[i]]) {
inv[x[i]]++;
}
}
for(int j=x[i]+1; j<n; ++j) {
if(a[x[i]] > a[j] && old <= a[j]) {
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |