| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1322538 | Robert_junior | Bubble Sort 2 (JOI18_bubblesort2) | C++20 | 0 ms | 0 KiB |
#include "bubblesort2.h"
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
vector<int> countScans(vector<int> A,vector<int> X,vector<int> V){
int q = X.size(), n = A.size();
vector<int> answer(q);
for (int j=0;j<q;j++) {
A[X[j]] = V[j];
int ans = 0;
for(int i = 0; i < n; i++){
int cnt = 0;
for(int j = i + 1; j < n; j++){
if(A[j] < A[i]) cnt++;
}
ans = max(ans, cnt);
}
answer[i] = ans;
}
return answer;
}
