#pragma GCC optimize("Ofast")
#pragma GCC target("avx2,popcnt,bmi,bmi2")
void count_5da(const int **x, unsigned *out, int M, int N) {
#define n 100000
#define P(k) {x[k][i+M], x[k][i+1+M], x[k][i+2+M], x[k][i+3+M]}
#define Q(k) (r[0][k]<x[0][j+N] & r[1][k]<x[1][j+N] & r[2][k]<x[2][j+N] & r[3][k]<x[3][j+N])
for (int i=0; i<n; i+=4) { int r[5][4] = {P(0), P(1), P(2), P(3)}; for (int j=0; j<n; ++j) {
out[j+N] += Q(0) + Q(1) + Q(2) + Q(3);
}}
}
#undef n
void count_4d(int n, const int **x, unsigned *out) {
count_5da(x, out, 0, 0);
count_5da(x, out, 0, 100000);
count_5da(x, out, 0, 200000);
count_5da(x, out, 100000, 0);
count_5da(x, out, 100000, 100000);
count_5da(x, out, 100000, 200000);
count_5da(x, out, 200000, 0);
count_5da(x, out, 200000, 100000);
count_5da(x, out, 200000, 200000);
}
Compilation | N/A | N/A | Compile OK | Score: N/A | 显示更多 |
Testcase #1 | 11.184 s | 1 MB + 156 KB | Accepted | Score: 100 | 显示更多 |