提交记录 22522


用户 题目 状态 得分 用时 内存 语言 代码长度
Frodo 1001c. 测测你的排序4 Wrong Answer 0 3.127 s 1048864 KB C++ 537 B
提交时间 评测时间
2024-09-18 10:39:20 2024-09-18 10:39:28
#include<bits/stdc++.h>
const int N=1<<27,B=16;
unsigned b[N],cnt[1<<B];
void sort(unsigned *a,int n){
	int T=(1<<B)-1;
	for(int i=0;i<(1<<B);i++) cnt[i]=0;
	for(int i=0;i<n;i++) cnt[a[i]&T]++;
	for(int i=0;i<(1<<B);i++) cnt[i]+=cnt[i-1];
	for(int i=n-1;i>=0;i--) b[--cnt[a[i]&T]]=a[i];
	// for(int i=0;i<n;i++) a[i]=b[i];
	for(int i=0;i<(1<<B);i++) cnt[i]=0;
	for(int i=0;i<n;i++) cnt[(b[i]>>B)&T]++;
	for(int i=0;i<(1<<B);i++) cnt[i]+=cnt[i-1];
	for(int i=n-1;i>=0;i--) a[--cnt[(a[i]>>B)&T]]=b[i];
	// for(int i=0;i<n;i++) a[i]=b[i];
}

CompilationN/AN/ACompile OKScore: N/A

Testcase #13.127 s1024 MB + 288 KBWrong AnswerScore: 0


Judge Duck Online | 评测鸭在线
Server Time: 2025-07-12 17:52:15 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠