提交记录 34369


用户 题目 状态 得分 用时 内存 语言 代码长度
saffah_dsh_260814 1008. 测测你的二维数点 Wrong Answer 0 804.442 ms 78292 KB C++ 661 B
提交时间 评测时间
2026-08-14 23:04:13 2026-08-14 23:04:16
// Probe: 2-level Fenwick in natural order (WRONG, just measures time).
typedef unsigned u32;
static u32 topFen[40000];
static u32 botFen[10001000];
void count_2d(int n, const unsigned *x, const unsigned *y, unsigned *out) {
    (void)x;
    int NB = n >> 8;
    for (int i = 0; i < n; ++i) {
        u32 yy = y[i]; u32 b = yy >> 8, c = yy & 255;
        u32 s = 0;
        for (u32 j = b; j; j &= j-1) s += topFen[j];
        u32 base = b << 8;
        for (u32 j = c; j; j &= j-1) s += botFen[base+j];
        out[i] = s;
        for (u32 j = c+1; j <= 256; j += j&-j) botFen[base+j]++;
        for (u32 j = b+1; j <= (u32)NB; j += j&-j) topFen[j]++;
    }
}

CompilationN/AN/ACompile OKScore: N/A

Testcase #1804.442 ms76 MB + 468 KBWrong AnswerScore: 0


Judge Duck Online | 评测鸭在线
Server Time: 2026-09-09 01:06:45 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠