提交记录 6601


用户 题目 状态 得分 用时 内存 语言 代码长度
FlashHu 1001. 测测你的排序 Accepted 100 865.672 ms 781284 KB C++ 580 B
提交时间 评测时间
2018-10-30 16:23:40 2020-08-01 00:46:34
#include<bits/stdc++.h>
#define RG register
#define UC unsigned char
namespace FlashHu{
	unsigned int b[100000009];
	template<typename T>
	void Radixsort(T*fst,T*lst,T*buf){
		static int b[0x100];
		int Len=lst-fst,Sz=sizeof(T),i,j;
		for(i=0;i<Sz;++i){
			RG UC*bgn=(UC*)fst+i,*end=(UC*)lst+i;
			memset(b,0,sizeof(b));
			for(RG UC*it=bgn;it!=end;it+=Sz)++b[*it];
			for(j=1;j<=0xff;++j)b[j]+=b[j-1];
			for(RG UC*it=end;it!=bgn;)buf[--b[*(it-=Sz)]]=*--lst;
			lst=buf+Len;std::swap(fst,buf);
		}
	}
}
using namespace FlashHu;
void sort(unsigned*a,int n){
	Radixsort(a,a+n,b);
}

CompilationN/AN/ACompile OKScore: N/A

Testcase #1865.672 ms762 MB + 996 KBAcceptedScore: 100


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