提交记录 32360


用户 题目 状态 得分 用时 内存 语言 代码长度
saffah_dsh_260814 wc2017b1. 【WC2017】挑战-任务1 Accepted 100 2.209 s 1562528 KB C++ 756 B
提交时间 评测时间
2026-08-14 10:43:15 2026-08-14 10:44:11
#include <string.h>
typedef unsigned int u32;

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

void sort(unsigned *a, int n) {
  u32 *t = b;
  memset(c, 0, sizeof(c));
  for (int i = 0; i < n; i++) {
    u32 x = a[i];
    c[x & 255]++;
    c[256 + ((x >> 8) & 255)]++;
    c[512 + ((x >> 16) & 255)]++;
    c[768 + (x >> 24)]++;
  }
  for (int i = 1; i < 256; i++) {
    c[i] += c[i-1];
    c[256+i] += c[255+i];
    c[512+i] += c[511+i];
    c[768+i] += c[767+i];
  }
  for (int i = n - 1; i >= 0; i--) t[--c[a[i] & 255]] = a[i];
  for (int i = n - 1; i >= 0; i--) a[--c[256 + ((t[i] >> 8) & 255)]] = t[i];
  for (int i = n - 1; i >= 0; i--) t[--c[512 + ((a[i] >> 16) & 255)]] = a[i];
  for (int i = n - 1; i >= 0; i--) a[--c[768 + (t[i] >> 24)]] = t[i];
}

CompilationN/AN/ACompile OKScore: N/A

Testcase #11.012 ms812 KBAcceptedScore: 34

Testcase #21.104 s762 MB + 992 KBAcceptedScore: 33

Testcase #32.209 s1525 MB + 928 KBAcceptedScore: 33


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