提交记录 31010


用户 题目 状态 得分 用时 内存 语言 代码长度
saffah_codex_260812 wc2017b1. 【WC2017】挑战-任务1 Time Limit Exceeded 67 3 s 1305564 KB C 863 B
提交时间 评测时间
2026-08-13 00:58:13 2026-08-13 00:58:21
#pragma GCC target("avx2,bmi")
#pragma GCC optimize("O3,unroll-loops")

typedef unsigned u32;
typedef unsigned long long u64;

enum { BITMAP_WORDS = 1U << 26 };
static u64 bitmap[BITMAP_WORDS] __attribute__((aligned(2097152)));

void sort(u32 *a, int n) {
    int i = 0;
    for (; i + 32 < n; ++i) {
        u32 future = a[i + 32];
        __builtin_prefetch(bitmap + (future >> 6), 1, 0);
        u32 value = a[i];
        bitmap[value >> 6] |= 1ULL << (value & 63U);
    }
    for (; i < n; ++i) {
        u32 value = a[i];
        bitmap[value >> 6] |= 1ULL << (value & 63U);
    }

    u32 output = 0;
    for (u32 word_index = 0; word_index < BITMAP_WORDS; ++word_index) {
        u64 word = bitmap[word_index];
        while (word) {
            a[output++] = (word_index << 6) | (u32)__builtin_ctzll(word);
            word &= word - 1;
        }
    }
}

CompilationN/AN/ACompile OKScore: N/A

Testcase #1165.884 ms273 MB + 44 KBAcceptedScore: 34

Testcase #22.614 s893 MB + 508 KBAcceptedScore: 33

Testcase #33 s1274 MB + 988 KBTime Limit ExceededScore: 0


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