#include<bits/stdc++.h>
#include "bubblesort2.h"
using namespace std ;
vector<int> countScans(vector<int> A,vector<int> X,vector<int> V){
int Q=A.size();
int B = X.size() ;
vector<int> ret ;
vector<int> aux;
for(int i = 0 ;i < B ;i++){
A[X[i]] = V[i] ;
aux.clear() ;
for(int j = 0;j < Q ;j ++){
aux.push_back(A[j]) ;
}
int ans = 0 ;
for(int j = 0 ;j < Q ;j ++){
int kk = 0 ;
for(int k = 0 ; k < j ; k ++ ){
kk+=(aux[k] > aux[j]) ;
}
ans = max(ans , kk ) ;
}
ret.push_back(ans) ;
}
return ret;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
67 ms |
384 KB |
Output is correct |
2 |
Correct |
224 ms |
384 KB |
Output is correct |
3 |
Correct |
3109 ms |
552 KB |
Output is correct |
4 |
Correct |
3094 ms |
384 KB |
Output is correct |
5 |
Correct |
3103 ms |
504 KB |
Output is correct |
6 |
Correct |
3103 ms |
504 KB |
Output is correct |
7 |
Correct |
3083 ms |
436 KB |
Output is correct |
8 |
Correct |
3095 ms |
384 KB |
Output is correct |
9 |
Correct |
3094 ms |
552 KB |
Output is correct |
10 |
Correct |
3108 ms |
512 KB |
Output is correct |
11 |
Correct |
3116 ms |
548 KB |
Output is correct |
12 |
Correct |
3121 ms |
552 KB |
Output is correct |
13 |
Correct |
3113 ms |
512 KB |
Output is correct |
14 |
Correct |
3147 ms |
636 KB |
Output is correct |
15 |
Correct |
3123 ms |
632 KB |
Output is correct |
16 |
Correct |
3116 ms |
504 KB |
Output is correct |
17 |
Correct |
3105 ms |
432 KB |
Output is correct |
18 |
Correct |
3089 ms |
504 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
67 ms |
384 KB |
Output is correct |
2 |
Correct |
224 ms |
384 KB |
Output is correct |
3 |
Correct |
3109 ms |
552 KB |
Output is correct |
4 |
Correct |
3094 ms |
384 KB |
Output is correct |
5 |
Correct |
3103 ms |
504 KB |
Output is correct |
6 |
Correct |
3103 ms |
504 KB |
Output is correct |
7 |
Correct |
3083 ms |
436 KB |
Output is correct |
8 |
Correct |
3095 ms |
384 KB |
Output is correct |
9 |
Correct |
3094 ms |
552 KB |
Output is correct |
10 |
Correct |
3108 ms |
512 KB |
Output is correct |
11 |
Correct |
3116 ms |
548 KB |
Output is correct |
12 |
Correct |
3121 ms |
552 KB |
Output is correct |
13 |
Correct |
3113 ms |
512 KB |
Output is correct |
14 |
Correct |
3147 ms |
636 KB |
Output is correct |
15 |
Correct |
3123 ms |
632 KB |
Output is correct |
16 |
Correct |
3116 ms |
504 KB |
Output is correct |
17 |
Correct |
3105 ms |
432 KB |
Output is correct |
18 |
Correct |
3089 ms |
504 KB |
Output is correct |
19 |
Execution timed out |
9035 ms |
512 KB |
Time limit exceeded |
20 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
9043 ms |
768 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
67 ms |
384 KB |
Output is correct |
2 |
Correct |
224 ms |
384 KB |
Output is correct |
3 |
Correct |
3109 ms |
552 KB |
Output is correct |
4 |
Correct |
3094 ms |
384 KB |
Output is correct |
5 |
Correct |
3103 ms |
504 KB |
Output is correct |
6 |
Correct |
3103 ms |
504 KB |
Output is correct |
7 |
Correct |
3083 ms |
436 KB |
Output is correct |
8 |
Correct |
3095 ms |
384 KB |
Output is correct |
9 |
Correct |
3094 ms |
552 KB |
Output is correct |
10 |
Correct |
3108 ms |
512 KB |
Output is correct |
11 |
Correct |
3116 ms |
548 KB |
Output is correct |
12 |
Correct |
3121 ms |
552 KB |
Output is correct |
13 |
Correct |
3113 ms |
512 KB |
Output is correct |
14 |
Correct |
3147 ms |
636 KB |
Output is correct |
15 |
Correct |
3123 ms |
632 KB |
Output is correct |
16 |
Correct |
3116 ms |
504 KB |
Output is correct |
17 |
Correct |
3105 ms |
432 KB |
Output is correct |
18 |
Correct |
3089 ms |
504 KB |
Output is correct |
19 |
Execution timed out |
9035 ms |
512 KB |
Time limit exceeded |
20 |
Halted |
0 ms |
0 KB |
- |