提交记录 28368


用户 题目 状态 得分 用时 内存 语言 代码长度
Z_301 1001. 测测你的排序 Accepted 100 980.288 ms 781288 KB C++11 1.17 KB
提交时间 评测时间
2025-07-27 23:39:32 2025-07-27 23:39:37
#include<bits/stdc++.h>
#define For(i,l,r) for(int i=l,i##_e=r;i<=i##_e;++i)
#define rFor(i,r,l) for(int i=r,i##_e=l;i>=i##_e;--i)
#define y0 y_zero
#define y1 y_one
#define all(a) a.begin(),a.end()
#define cmin(a,b) a=min<remove_reference<decltype(a)>::type>(a,b)
#define cmax(a,b) a=max<remove_reference<decltype(a)>::type>(a,b)
#define vect basic_string
// #define ensure(_) ((_) || (__builtin_unreachable(),0))
using namespace std;
using u32=unsigned;
using i64=long long;
using ll=long long;
using u64=unsigned long long;
using ull=unsigned long long;
#if __SIZEOF_POINTER__==8
using i128=__int128;
using u128=__uint128_t;
#endif
using pii=array<int,2>;
using pll=array<ll,2>;
using a3=array<int,3>;
using a4=array<int,4>;
using a5=array<int,5>;
#define mtc() int T; cin>>T; while(T--) work();

template<class T> void bsort(T *a,const int n) {
	static constexpr int S=1<<8;
	static u32 h[S]; T *b=new T[n];
	auto _s=[&](T *a,T *b,int k) {
		memset(h,0,sizeof(h));
		For(i,0,n-1) ++h[a[i]>>k&(S-1)];
		For(i,1,S-1) h[i]+=h[i-1];
		rFor(i,n-1,0) b[--h[a[i]>>k&(S-1)]]=a[i];
	};
	For(i,0,sizeof(T)/2-1) {
		_s(a,b,i*16);
		_s(b,a,i*16+8);
	}
	delete[] b;
}
void sort(u32 *a,int n) {
	bsort(a,n);
}

CompilationN/AN/ACompile OKScore: N/A

Testcase #1980.288 ms762 MB + 1000 KBAcceptedScore: 100


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