提交记录 22024
提交时间 |
评测时间 |
2024-07-29 19:56:12 |
2024-07-29 19:56:17 |
#include <algorithm>
using namespace std;
constexpr int mask(int x) { return x + (x >> 10); }
constexpr int kN = 1e7;
int h[kN], p[kN];
int f[mask(kN) + 1];
void count_2d(int n, const unsigned *x, const unsigned *y, unsigned *out) {
fill_n(h, n, -1);
for (int i = 0; i < n; ++i) {
p[i] = h[x[i]];
h[x[i]] = i;
}
for (int i = 0; i < n; ++i) {
for (int j = h[i]; ~j; j = p[j]) {
unsigned &s = out[j];
for (int x = y[j]; x; x &= x - 1) {
s += f[mask(x)];
}
}
for (int j = h[i]; ~j; j = p[j]) {
for (int x = y[j] + 1; x <= n; x += x & -x) {
++f[mask(x)];
}
}
}
}
Compilation | N/A | N/A | Compile OK | Score: N/A | 显示更多 |
Testcase #1 | 2.458 s | 152 MB + 648 KB | Accepted | Score: 100 | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2025-07-15 14:50:43 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠