提交记录 8299


用户 题目 状态 得分 用时 内存 语言 代码长度
Ressed 1001. 测测你的排序 Compile Error 0 0 ns 0 KB C++ 453 B
提交时间 评测时间
2019-02-11 22:29:56 2020-08-01 01:15:14
#include<bits/stdc++.h>
using namespace std;
typedef unsigned int ui;
const ui maxn=1e8+5,maxm=0x10000,P=0xffff;

ui tmp[maxn],cnt[maxm];

void sort(ui *a, int n) {
	CLR(cnt,0);
	for(int i=0;i<n;i++) cnt[a[i]&P]++;
	for(ui i=1;i<=P;i++) cnt[i]+=cnt[i-1];
	for(int i=n-1;i>=0;i--) tmp[--cnt[a[i]&P]]=a[i];
	CLR(cnt,0);
	for(int i=0;i<n;i++) cnt[a[i]>>16]++;
	for(ui i=1;i<=P;i++) cnt[i]+=cnt[i-1];
	for(int i=n-1;i>=0;i--) a[--cnt[tmp[i]>>16]]=tmp[i];
}

CompilationN/AN/ACompile ErrorScore: N/A


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