#include<bits/stdc++.h>
//#include "bubblesort2.h"
//#include "grader.cpp"
using namespace std;
#define ll long long
#define pii pair<int,int>
#define pll pair<ll,ll>
#define vi vector<int>
#define vl vector<ll>
#define mp make_pair
#define pb push_back
int q,n;
vector<int> countScans(vector<int> arr,vector<int> X, vector<int> V){
q = X.size();
n = arr.size();
vi ans;
for(int i = 0; i < q; i++){
arr[X[i]] = V[i];
int rez = 0;
for(int j = 0; j < n; j++){
bool done = false;
for(int k = j + 1; k < n; k++){
if(arr[j] > arr[k]){
swap(arr[j], arr[k]);
if(!done){
done = true;
rez++;
}
}
else
continue;
}
}
ans.pb(rez);
}
return ans;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
57 ms |
292 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
57 ms |
292 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
9008 ms |
468 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
57 ms |
292 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |