# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
852924 | vjudge1 | Bubble Sort 2 (JOI18_bubblesort2) | C++17 | 8537 ms | 4180 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.
// by me
#include "bubblesort2.h"
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define endl '\n'
#define all(x) x.begin(), x.end()
std::vector<int> countScans(std::vector<int> A, std::vector<int> X, std::vector<int> V){
int Q = X.size();
int N = A.size();
vector<int> ans(Q, 0);
if(N <= 2000){
for(int i = 0; i < Q; i++){
A[X[i]] = V[i];
auto f = A;
while(!is_sorted(all(f))){
ans[i]++;
for(int i = 1; i < f.size(); i++){
if(f[i] < f[i - 1]) swap(f[i], f[i - 1]);
}
}
}
return ans;
}
vector<set<int>> f(101);
for(int i = 0; i < N; i++){
f[A[i]].insert(i);
}
Compilation message (stderr)
# | 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... |