提交记录 20484


用户 题目 状态 得分 用时 内存 语言 代码长度
konjaklaf 1001. 测测你的排序 Accepted 100 786.045 ms 781276 KB C++ 914 B
提交时间 评测时间
2023-10-29 22:36:59 2023-10-29 22:37:04
#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;) {
        #define add x = a[i], ++t0[x & ful], ++t1[x >> 8 & ful], ++t2[x >> 16 & ful], ++t3[x >> 24], ++i;
        add add add add
        #undef add
    }
#define sor(a, b, tc, op) \
    p = b - 1; \
    for (i = 0; i <= ful; i++) t[i] = p, p += tc[i]; \
    for (i = 0; i < n; i += 8) { \
        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]; \
        *(++t[p[4] op]) = p[4]; \
        *(++t[p[5] op]) = p[5]; \
        *(++t[p[6] op]) = p[6]; \
        *(++t[p[7] op]) = p[7]; \
    }
    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 #1786.045 ms762 MB + 988 KBAcceptedScore: 100


Judge Duck Online | 评测鸭在线
Server Time: 2024-05-08 00:59:07 | Loaded in 0 ms | Server Status
个人娱乐项目,仅供学习交流使用