#include "bubblesort2.h"
#include <bits/stdc++.h>
using namespace std;
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
//#pragma GCC optimize("O3")
//#pragma GCC optimize("unroll-loops")
std::vector<int> countScans(std::vector<int> a,std::vector<int> x,std::vector<int> v){
int n = a.size(), q = x.size();
vector <int> s(q, n - 1);
for(int f = 0; f < q; ++f) {
a[x[f]] = v[f];
int mx = 0;
for (int i = 0; i < n; ++i) {
int cnt = 0;
for (int j = 0; j < i; ++j) {
if (a[j] > a[i]) {
++cnt;
}
}
mx = max(mx, cnt);
}
s[f] = mx;
}
return s;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
62 ms |
364 KB |
Output is correct |
2 |
Correct |
218 ms |
364 KB |
Output is correct |
3 |
Correct |
3094 ms |
364 KB |
Output is correct |
4 |
Correct |
3112 ms |
472 KB |
Output is correct |
5 |
Correct |
3062 ms |
492 KB |
Output is correct |
6 |
Correct |
3106 ms |
492 KB |
Output is correct |
7 |
Correct |
3057 ms |
472 KB |
Output is correct |
8 |
Correct |
3074 ms |
472 KB |
Output is correct |
9 |
Correct |
3065 ms |
472 KB |
Output is correct |
10 |
Correct |
3056 ms |
464 KB |
Output is correct |
11 |
Correct |
3063 ms |
464 KB |
Output is correct |
12 |
Correct |
3083 ms |
464 KB |
Output is correct |
13 |
Correct |
3089 ms |
492 KB |
Output is correct |
14 |
Correct |
3083 ms |
364 KB |
Output is correct |
15 |
Correct |
3085 ms |
464 KB |
Output is correct |
16 |
Correct |
3053 ms |
364 KB |
Output is correct |
17 |
Correct |
3060 ms |
364 KB |
Output is correct |
18 |
Correct |
3128 ms |
492 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
62 ms |
364 KB |
Output is correct |
2 |
Correct |
218 ms |
364 KB |
Output is correct |
3 |
Correct |
3094 ms |
364 KB |
Output is correct |
4 |
Correct |
3112 ms |
472 KB |
Output is correct |
5 |
Correct |
3062 ms |
492 KB |
Output is correct |
6 |
Correct |
3106 ms |
492 KB |
Output is correct |
7 |
Correct |
3057 ms |
472 KB |
Output is correct |
8 |
Correct |
3074 ms |
472 KB |
Output is correct |
9 |
Correct |
3065 ms |
472 KB |
Output is correct |
10 |
Correct |
3056 ms |
464 KB |
Output is correct |
11 |
Correct |
3063 ms |
464 KB |
Output is correct |
12 |
Correct |
3083 ms |
464 KB |
Output is correct |
13 |
Correct |
3089 ms |
492 KB |
Output is correct |
14 |
Correct |
3083 ms |
364 KB |
Output is correct |
15 |
Correct |
3085 ms |
464 KB |
Output is correct |
16 |
Correct |
3053 ms |
364 KB |
Output is correct |
17 |
Correct |
3060 ms |
364 KB |
Output is correct |
18 |
Correct |
3128 ms |
492 KB |
Output is correct |
19 |
Execution timed out |
9041 ms |
620 KB |
Time limit exceeded |
20 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
9061 ms |
620 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
62 ms |
364 KB |
Output is correct |
2 |
Correct |
218 ms |
364 KB |
Output is correct |
3 |
Correct |
3094 ms |
364 KB |
Output is correct |
4 |
Correct |
3112 ms |
472 KB |
Output is correct |
5 |
Correct |
3062 ms |
492 KB |
Output is correct |
6 |
Correct |
3106 ms |
492 KB |
Output is correct |
7 |
Correct |
3057 ms |
472 KB |
Output is correct |
8 |
Correct |
3074 ms |
472 KB |
Output is correct |
9 |
Correct |
3065 ms |
472 KB |
Output is correct |
10 |
Correct |
3056 ms |
464 KB |
Output is correct |
11 |
Correct |
3063 ms |
464 KB |
Output is correct |
12 |
Correct |
3083 ms |
464 KB |
Output is correct |
13 |
Correct |
3089 ms |
492 KB |
Output is correct |
14 |
Correct |
3083 ms |
364 KB |
Output is correct |
15 |
Correct |
3085 ms |
464 KB |
Output is correct |
16 |
Correct |
3053 ms |
364 KB |
Output is correct |
17 |
Correct |
3060 ms |
364 KB |
Output is correct |
18 |
Correct |
3128 ms |
492 KB |
Output is correct |
19 |
Execution timed out |
9041 ms |
620 KB |
Time limit exceeded |
20 |
Halted |
0 ms |
0 KB |
- |