#include "bubblesort2.h"
#include <vector>
using namespace std;
vector<int> countScans(vector<int> a, vector<int> x, vector<int> v) {
int n = a.size();
int q = x.size();
vector<int> ret(q);
for(int t = 0; t < q; ++t) {
a[x[t]] = v[t];
int ans = 0;
for(int i = 1; i < n; ++i) {
int cnt = 0;
for(int j = 0; j < i; ++j) {
if(a[j] > a[i]) {
++cnt;
}
}
ans = max(ans, cnt);
}
ret[t] = ans;
}
return ret;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
62 ms |
512 KB |
Output is correct |
2 |
Correct |
216 ms |
492 KB |
Output is correct |
3 |
Correct |
3128 ms |
364 KB |
Output is correct |
4 |
Correct |
3107 ms |
512 KB |
Output is correct |
5 |
Correct |
3092 ms |
540 KB |
Output is correct |
6 |
Correct |
3100 ms |
492 KB |
Output is correct |
7 |
Correct |
3106 ms |
412 KB |
Output is correct |
8 |
Correct |
3121 ms |
412 KB |
Output is correct |
9 |
Correct |
3158 ms |
500 KB |
Output is correct |
10 |
Correct |
3155 ms |
412 KB |
Output is correct |
11 |
Correct |
3133 ms |
412 KB |
Output is correct |
12 |
Correct |
3110 ms |
412 KB |
Output is correct |
13 |
Correct |
3133 ms |
492 KB |
Output is correct |
14 |
Correct |
3111 ms |
492 KB |
Output is correct |
15 |
Correct |
3090 ms |
540 KB |
Output is correct |
16 |
Correct |
3116 ms |
492 KB |
Output is correct |
17 |
Correct |
3086 ms |
412 KB |
Output is correct |
18 |
Correct |
3117 ms |
492 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
62 ms |
512 KB |
Output is correct |
2 |
Correct |
216 ms |
492 KB |
Output is correct |
3 |
Correct |
3128 ms |
364 KB |
Output is correct |
4 |
Correct |
3107 ms |
512 KB |
Output is correct |
5 |
Correct |
3092 ms |
540 KB |
Output is correct |
6 |
Correct |
3100 ms |
492 KB |
Output is correct |
7 |
Correct |
3106 ms |
412 KB |
Output is correct |
8 |
Correct |
3121 ms |
412 KB |
Output is correct |
9 |
Correct |
3158 ms |
500 KB |
Output is correct |
10 |
Correct |
3155 ms |
412 KB |
Output is correct |
11 |
Correct |
3133 ms |
412 KB |
Output is correct |
12 |
Correct |
3110 ms |
412 KB |
Output is correct |
13 |
Correct |
3133 ms |
492 KB |
Output is correct |
14 |
Correct |
3111 ms |
492 KB |
Output is correct |
15 |
Correct |
3090 ms |
540 KB |
Output is correct |
16 |
Correct |
3116 ms |
492 KB |
Output is correct |
17 |
Correct |
3086 ms |
412 KB |
Output is correct |
18 |
Correct |
3117 ms |
492 KB |
Output is correct |
19 |
Execution timed out |
9035 ms |
492 KB |
Time limit exceeded |
20 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
9038 ms |
492 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
62 ms |
512 KB |
Output is correct |
2 |
Correct |
216 ms |
492 KB |
Output is correct |
3 |
Correct |
3128 ms |
364 KB |
Output is correct |
4 |
Correct |
3107 ms |
512 KB |
Output is correct |
5 |
Correct |
3092 ms |
540 KB |
Output is correct |
6 |
Correct |
3100 ms |
492 KB |
Output is correct |
7 |
Correct |
3106 ms |
412 KB |
Output is correct |
8 |
Correct |
3121 ms |
412 KB |
Output is correct |
9 |
Correct |
3158 ms |
500 KB |
Output is correct |
10 |
Correct |
3155 ms |
412 KB |
Output is correct |
11 |
Correct |
3133 ms |
412 KB |
Output is correct |
12 |
Correct |
3110 ms |
412 KB |
Output is correct |
13 |
Correct |
3133 ms |
492 KB |
Output is correct |
14 |
Correct |
3111 ms |
492 KB |
Output is correct |
15 |
Correct |
3090 ms |
540 KB |
Output is correct |
16 |
Correct |
3116 ms |
492 KB |
Output is correct |
17 |
Correct |
3086 ms |
412 KB |
Output is correct |
18 |
Correct |
3117 ms |
492 KB |
Output is correct |
19 |
Execution timed out |
9035 ms |
492 KB |
Time limit exceeded |
20 |
Halted |
0 ms |
0 KB |
- |