提交记录 21927


用户 题目 状态 得分 用时 内存 语言 代码长度
Minion 1001c. 测测你的排序4 Accepted 100 16.245 s 1048588 KB C++14 852 B
提交时间 评测时间
2024-07-15 12:48:34 2024-07-15 12:48:55
#define fo(i,x,y) for(int i = x;i <= y;++i)
#define u32 unsigned
u32 B[140000010],cnt[310];
void sort(u32 *a,int n)
{
	fo(i,0,255) cnt[i] = 0;
	for(u32 *i = a;i != a + n;++i) ++cnt[*i & 255];
	fo(i,1,255) cnt[i] += cnt[i - 1];
	for(u32 *i = a + n - 1;i != a - 1;--i) B[--cnt[*i & 255]] = *i;

	fo(i,0,255) cnt[i] = 0;
	for(u32 *i = B;i != B + n;++i) ++cnt[*i >> 8 & 255];
	fo(i,1,255) cnt[i] += cnt[i - 1];
	for(u32 *i = B + n - 1;i != B - 1;--i) a[--cnt[*i >> 8 & 255]] = *i;

	fo(i,0,255) cnt[i] = 0;
	for(u32 *i = a;i != a + n;++i) ++cnt[*i >> 16 & 255];
	fo(i,1,255) cnt[i] += cnt[i - 1];
	for(u32 *i = a + n - 1;i != a - 1;--i) B[--cnt[*i >> 16 & 255]] = *i;

	fo(i,0,255) cnt[i] = 0;
	for(u32 *i = B;i != B + n;++i) ++cnt[*i >> 24 & 255];
	fo(i,1,255) cnt[i] += cnt[i - 1];
	for(u32 *i = B + n - 1;i != B - 1;--i) a[--cnt[*i >> 24 & 255]] = *i;
}

CompilationN/AN/ACompile OKScore: N/A

Testcase #116.245 s1024 MB + 12 KBAcceptedScore: 100


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