提交记录 11193


用户 题目 状态 得分 用时 内存 语言 代码长度
AThousandMoon 1001. 测测你的排序 Compile Error 0 0 ns 0 KB C++ 739 B
提交时间 评测时间
2019-11-05 15:23:56 2020-08-01 02:39:45
#include<bits/stdc++.h>
#define Rint register int
using namespace std;
inline void sort(unsigned *a, int n){
	unsigned *b = new unsigned [n];
	int cnt[4][256];
	for(Rint i = 0;i < n;++ i){
		++ cnt[0][a[i] & 255];
		++ cnt[1][(a[i] >> 8) & 255];
		++ cnt[2][(a[i] >> 16) & 255];
		++ cnt[3][a[i] >> 24];
	}
	for(Rint i = 1;i < 256;++ i){
		cnt[0][i] += cnt[0][i - 1];
		cnt[1][i] += cnt[1][i - 1];
		cnt[2][i] += cnt[2][i - 1];
		cnt[3][i] += cnt[3][i - 1];
	}
	for(Rint i = n - 1;~i;-- i) b[-- cnt[0][a[i] & 255]] = a[i];
	for(Rint i = n - 1;~i;-- i) a[-- cnt[1][(a[i] >> 8) & 255]] = b[i];
	for(Rint i = n - 1;~i;-- i) b[-- cnt[2][(a[i] >> 16) & 255]] = a[i];
	for(Rint i = n - 1;~i;-- i) a[-- cnt[3][a[i] >> 24]] = b[i];
	delete [] b;
}

CompilationN/AN/ACompile ErrorScore: N/A


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