#include "bubblesort2.h"
#include <bits/stdc++.h>
using namespace std;
vector<int> countScans(vector<int> A,vector<int> X,vector<int> V){
int Q=X.size();
vector<int> answer;
int n = (int)A.size();
for(int i = 0; i < Q; i++){
A[X[i]] = V[i];
auto b = A;
for(int it = 0; it <= n; it++){
bool f = false;
for(int j = 0; j + 1 < n; j++){
if(b[j] > b[j + 1]){
swap(b[j], b[j + 1]);
f = true;
}
}
if(!f){
answer.push_back(it);
break;
}
}
}
return answer;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
288 ms |
324 KB |
Output is correct |
2 |
Correct |
977 ms |
444 KB |
Output is correct |
3 |
Execution timed out |
9039 ms |
384 KB |
Time limit exceeded |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
288 ms |
324 KB |
Output is correct |
2 |
Correct |
977 ms |
444 KB |
Output is correct |
3 |
Execution timed out |
9039 ms |
384 KB |
Time limit exceeded |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
9085 ms |
592 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
288 ms |
324 KB |
Output is correct |
2 |
Correct |
977 ms |
444 KB |
Output is correct |
3 |
Execution timed out |
9039 ms |
384 KB |
Time limit exceeded |
4 |
Halted |
0 ms |
0 KB |
- |