提交记录 20480


用户 题目 状态 得分 用时 内存 语言 代码长度
konjaklaf 1001. 测测你的排序 Accepted 100 2.63 s 781780 KB C++ 1.09 KB
提交时间 评测时间
2023-10-29 21:43:39 2023-10-29 21:43:45
#include <algorithm>

#pragma GCC optimize("3,inline,Ofast,no-stack-protector,unroll-loops,fast-math")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4.1,sse4.2,avx,avx2,popcnt,tune=native")
const int ful = (1 << 16) - 1;
int t0[ful + 1], t1[ful + 1];
unsigned *b = new unsigned[100000000];
void sort(unsigned *a, int n) {
    int i;
    for (i = 0; i < n;) {
        ++t0[a[i] & ful], ++t1[(a[i] >> 16) & ful], ++i;
        ++t0[a[i] & ful], ++t1[(a[i] >> 16) & ful], ++i;
        ++t0[a[i] & ful], ++t1[(a[i] >> 16) & ful], ++i;
        ++t0[a[i] & ful], ++t1[(a[i] >> 16) & ful], ++i;
    }
    for (i = 1; i <= ful; ++i) {
        t0[i] += t0[i - 1], t1[i] += t1[i - 1];
    }
    for (i = n - 1; i >= 0;) {
        b[--t0[a[i] & ful]] = a[i], --i;
        b[--t0[a[i] & ful]] = a[i], --i;
        b[--t0[a[i] & ful]] = a[i], --i;
        b[--t0[a[i] & ful]] = a[i], --i;
    }
    
    for (i = n - 1; i >= 0;) {
        a[--t1[(b[i] >> 16) & ful]] = b[i], --i;
        a[--t1[(b[i] >> 16) & ful]] = b[i], --i;
        a[--t1[(b[i] >> 16) & ful]] = b[i], --i;
        a[--t1[(b[i] >> 16) & ful]] = b[i], --i;
    }
}

CompilationN/AN/ACompile OKScore: N/A

Testcase #12.63 s763 MB + 468 KBAcceptedScore: 100


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