提交记录 20482


用户 题目 状态 得分 用时 内存 语言 代码长度
konjaklaf 1001. 测测你的排序 Runtime Error 0 332.761 ms 391548 KB C++ 1.00 KB
提交时间 评测时间
2023-10-29 22:34:09 2023-10-29 22:34:14
#include <algorithm>

#define ful 255
int t0[ful + 1], t1[ful + 1], t2[ful + 1], t3[ful + 1];
unsigned *b = new unsigned[100000000], *t[ful + 1], *p;
void sort(unsigned *a, int n) {
    unsigned int i, x;
    for (i = 0; i < n;) {
        x = a[i], ++t0[x & ful], ++t1[x >> 8 & ful], ++t2[x >> 16 & ful], ++t3[x >> 24], ++i;
        x = a[i], ++t0[x & ful], ++t1[x >> 8 & ful], ++t2[x >> 16 & ful], ++t3[x >> 24], ++i;
        x = a[i], ++t0[x & ful], ++t1[x >> 8 & ful], ++t2[x >> 16 & ful], ++t3[x >> 24], ++i;
        x = a[i], ++t0[x & ful], ++t1[x >> 8 & ful], ++t2[x >> 16 & ful], ++t3[x >> 24], ++i;
    }
#define sor(a, b, tc, op) \
    p = b - 1; \
    for (i = 0; i <= ful; i++) t[i] = p, p += t0[i]; \
    for (i = 0; i < n; i += 4) { \
        p = a + i; \
        *(++t[p[0] op]) = p[0]; \
        *(++t[p[1] op]) = p[1]; \
        *(++t[p[2] op]) = p[2]; \
        *(++t[p[3] op]) = p[3]; \
    }
    sor(a, b, t0, & ful);
    sor(b, a, t1, >> 8 & ful);
    sor(a, b, t2, >> 16 & ful);
    sor(b, a, t3, >> 24);
}

CompilationN/AN/ACompile OKScore: N/A

Testcase #1332.761 ms382 MB + 380 KBRuntime ErrorScore: 0


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