# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
143501 | shashwatchandra | Bubble Sort 2 (JOI18_bubblesort2) | C++17 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "bubblesort2.h"
#include <bits1/stdc++.h>
using namespace std;
#define REP(i,n) for(int i = 0;i < n;i++)
vector<int> countScans(vector<int> a,vector<int> x,vector<int> v){
vector<int> answer;
REP(i,x.size()){
a[x[i]] = v[i];
int ans = 0;
REP(i,a.size()){
int cur = 0;
REP(j,i){
if(a[j] > a[i])cur++;
}
ans = max(ans,cur);
}
answer.push_back(ans);
}
return answer;
}