Submission #1089572

#TimeUsernameProblemLanguageResultExecution timeMemory
1089572VMaksimoski008Bubble Sort 2 (JOI18_bubblesort2)C++17
0 / 100
9006 ms600 KiB
#include "bubblesort2.h" #include <bits/stdc++.h> using namespace std; vector<int> countScans(vector<int> A, vector<int> X, vector<int> V) { int n = A.size(), q = X.size(); vector<int> ans(q); for(int it=0; it<q; it++) { A[X[it]] = V[it]; while(!is_sorted(A.begin(), A.end())) { ans[it]++; for(int i=0; i+1<n; i++) if(A[i] > A[i+1]) swap(A[i], A[i+1]); } } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...