#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")
typedef long long ll;
#define ll int
const ll ADD = 100;
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 i = 0; i < n; ++i) {
a[i] = (ll)a[i] * ADD + (ll)i;
}
for(int f = 0; f < q; ++f) {
a[x[f]] = (ll)v[f] * ADD + (ll)x[f];
ll mx = 0;
for (int i = 0; i < n; ++i) {
ll 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 |
Incorrect |
63 ms |
364 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
63 ms |
364 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
9027 ms |
620 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
63 ms |
364 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |