#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 time |
Memory |
Grader output |
1 |
Incorrect |
28 ms |
344 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
28 ms |
344 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
9006 ms |
600 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
28 ms |
344 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |