#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 ;
for(int i = 0 ;i < B ;i++){
A[X[i]] = V[i] ;
vector<pair<int,int> > aux ;
for(int j = 0;j < Q ;j ++){
aux.push_back({A[j] , j}) ;
}
sort(aux.begin() , aux.end()) ;
int ans = 0 ;
for(int j = 0 ;j < Q ; j++){
ans = max(ans , aux[j].second - j ) ;
}
ret.push_back(ans);
}
return ret;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
22 ms |
384 KB |
Output is correct |
2 |
Correct |
50 ms |
384 KB |
Output is correct |
3 |
Correct |
281 ms |
632 KB |
Output is correct |
4 |
Correct |
279 ms |
512 KB |
Output is correct |
5 |
Correct |
272 ms |
504 KB |
Output is correct |
6 |
Correct |
202 ms |
512 KB |
Output is correct |
7 |
Correct |
239 ms |
384 KB |
Output is correct |
8 |
Correct |
254 ms |
504 KB |
Output is correct |
9 |
Correct |
268 ms |
512 KB |
Output is correct |
10 |
Correct |
184 ms |
504 KB |
Output is correct |
11 |
Correct |
183 ms |
504 KB |
Output is correct |
12 |
Correct |
195 ms |
512 KB |
Output is correct |
13 |
Correct |
182 ms |
508 KB |
Output is correct |
14 |
Correct |
181 ms |
476 KB |
Output is correct |
15 |
Correct |
189 ms |
508 KB |
Output is correct |
16 |
Correct |
170 ms |
504 KB |
Output is correct |
17 |
Correct |
175 ms |
504 KB |
Output is correct |
18 |
Correct |
170 ms |
504 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
22 ms |
384 KB |
Output is correct |
2 |
Correct |
50 ms |
384 KB |
Output is correct |
3 |
Correct |
281 ms |
632 KB |
Output is correct |
4 |
Correct |
279 ms |
512 KB |
Output is correct |
5 |
Correct |
272 ms |
504 KB |
Output is correct |
6 |
Correct |
202 ms |
512 KB |
Output is correct |
7 |
Correct |
239 ms |
384 KB |
Output is correct |
8 |
Correct |
254 ms |
504 KB |
Output is correct |
9 |
Correct |
268 ms |
512 KB |
Output is correct |
10 |
Correct |
184 ms |
504 KB |
Output is correct |
11 |
Correct |
183 ms |
504 KB |
Output is correct |
12 |
Correct |
195 ms |
512 KB |
Output is correct |
13 |
Correct |
182 ms |
508 KB |
Output is correct |
14 |
Correct |
181 ms |
476 KB |
Output is correct |
15 |
Correct |
189 ms |
508 KB |
Output is correct |
16 |
Correct |
170 ms |
504 KB |
Output is correct |
17 |
Correct |
175 ms |
504 KB |
Output is correct |
18 |
Correct |
170 ms |
504 KB |
Output is correct |
19 |
Correct |
3905 ms |
812 KB |
Output is correct |
20 |
Correct |
5145 ms |
896 KB |
Output is correct |
21 |
Correct |
4467 ms |
888 KB |
Output is correct |
22 |
Correct |
4960 ms |
888 KB |
Output is correct |
23 |
Correct |
3274 ms |
888 KB |
Output is correct |
24 |
Correct |
3268 ms |
888 KB |
Output is correct |
25 |
Correct |
3241 ms |
864 KB |
Output is correct |
26 |
Correct |
3297 ms |
796 KB |
Output is correct |
27 |
Correct |
3216 ms |
868 KB |
Output is correct |
28 |
Correct |
3222 ms |
832 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
6458 ms |
1420 KB |
Output is correct |
2 |
Execution timed out |
9077 ms |
2496 KB |
Time limit exceeded |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
22 ms |
384 KB |
Output is correct |
2 |
Correct |
50 ms |
384 KB |
Output is correct |
3 |
Correct |
281 ms |
632 KB |
Output is correct |
4 |
Correct |
279 ms |
512 KB |
Output is correct |
5 |
Correct |
272 ms |
504 KB |
Output is correct |
6 |
Correct |
202 ms |
512 KB |
Output is correct |
7 |
Correct |
239 ms |
384 KB |
Output is correct |
8 |
Correct |
254 ms |
504 KB |
Output is correct |
9 |
Correct |
268 ms |
512 KB |
Output is correct |
10 |
Correct |
184 ms |
504 KB |
Output is correct |
11 |
Correct |
183 ms |
504 KB |
Output is correct |
12 |
Correct |
195 ms |
512 KB |
Output is correct |
13 |
Correct |
182 ms |
508 KB |
Output is correct |
14 |
Correct |
181 ms |
476 KB |
Output is correct |
15 |
Correct |
189 ms |
508 KB |
Output is correct |
16 |
Correct |
170 ms |
504 KB |
Output is correct |
17 |
Correct |
175 ms |
504 KB |
Output is correct |
18 |
Correct |
170 ms |
504 KB |
Output is correct |
19 |
Correct |
3905 ms |
812 KB |
Output is correct |
20 |
Correct |
5145 ms |
896 KB |
Output is correct |
21 |
Correct |
4467 ms |
888 KB |
Output is correct |
22 |
Correct |
4960 ms |
888 KB |
Output is correct |
23 |
Correct |
3274 ms |
888 KB |
Output is correct |
24 |
Correct |
3268 ms |
888 KB |
Output is correct |
25 |
Correct |
3241 ms |
864 KB |
Output is correct |
26 |
Correct |
3297 ms |
796 KB |
Output is correct |
27 |
Correct |
3216 ms |
868 KB |
Output is correct |
28 |
Correct |
3222 ms |
832 KB |
Output is correct |
29 |
Correct |
6458 ms |
1420 KB |
Output is correct |
30 |
Execution timed out |
9077 ms |
2496 KB |
Time limit exceeded |
31 |
Halted |
0 ms |
0 KB |
- |