提交记录 19878


用户 题目 状态 得分 用时 内存 语言 代码长度
lotus_f 1001. 测测你的排序 Accepted 100 2.492 s 781544 KB C++11 459 B
提交时间 评测时间
2023-08-11 16:38:30 2023-08-11 16:38:37
#include<bits/stdc++.h>
void sort(unsigned *a,int n)
{
	unsigned *b=new unsigned[n],*cnt=new unsigned[65536];
	memset(cnt,0,262144);
	for(int j=0; j<=n-1; ++j) ++cnt[a[j]&65535];
	for(int j=1; j<=65535; ++j) cnt[j]+=cnt[j-1];
	for(int j=n-1; j>=0; --j) b[--cnt[a[j]&65535]]=a[j];
	memset(cnt,0,262144);
	for(int j=0; j<=n-1; ++j) ++cnt[b[j]>>16&65535];
	for(int j=1; j<=65535; ++j) cnt[j]+=cnt[j-1];
	for(int j=n-1; j>=0; --j) a[--cnt[b[j]>>16&65535]]=b[j];
}

CompilationN/AN/ACompile OKScore: N/A

Testcase #12.492 s763 MB + 232 KBAcceptedScore: 100


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