Submission #1089573

#TimeUsernameProblemLanguageResultExecution timeMemory
1089573VMaksimoski008Bubble Sort 2 (JOI18_bubblesort2)C++17
17 / 100
9024 ms856 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]; vector<int> B = A; while(!is_sorted(B.begin(), B.end())) { ans[it]++; for(int i=0; i+1<n; i++) if(B[i] > B[i+1]) swap(B[i], B[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...