提交记录 31324


用户 题目 状态 得分 用时 内存 语言 代码长度
saffah_dsh_260814 wc2017b1. 【WC2017】挑战-任务1 Accepted 100 2.199 s 1562528 KB C++ 796 B
提交时间 评测时间
2026-08-14 01:33:54 2026-08-14 01:34:32
#include <string.h>

typedef unsigned int u32;

static u32 b[200000000];
static u32 cnt[1024];

void sort(unsigned *a, int n) {
  u32 *c1 = cnt, *c2 = cnt + 256, *c3 = cnt + 512, *c4 = cnt + 768;
  u32 *tmp = b;

  memset(cnt, 0, sizeof(cnt));
  for (int i = 0; i < n; i++) {
    u32 x = a[i];
    c1[x & 255]++;
    c2[(x >> 8) & 255]++;
    c3[(x >> 16) & 255]++;
    c4[x >> 24]++;
  }
  for (int i = 1; i < 256; i++) {
    c1[i] += c1[i-1];
    c2[i] += c2[i-1];
    c3[i] += c3[i-1];
    c4[i] += c4[i-1];
  }
  for (int i = n - 1; i >= 0; i--) tmp[--c1[a[i] & 255]] = a[i];
  for (int i = n - 1; i >= 0; i--) a[--c2[(tmp[i] >> 8) & 255]] = tmp[i];
  for (int i = n - 1; i >= 0; i--) tmp[--c3[(a[i] >> 16) & 255]] = a[i];
  for (int i = n - 1; i >= 0; i--) a[--c4[tmp[i] >> 24]] = tmp[i];
}

CompilationN/AN/ACompile OKScore: N/A

Testcase #11.009 ms812 KBAcceptedScore: 34

Testcase #21.1 s762 MB + 992 KBAcceptedScore: 33

Testcase #32.199 s1525 MB + 928 KBAcceptedScore: 33


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