提交记录 28370


用户 题目 状态 得分 用时 内存 语言 代码长度
Z_301 1001. 测测你的排序 Runtime Error 0 955.62 ms 40 KB C++11 1.20 KB
提交时间 评测时间
2025-07-27 23:44:58 2025-07-27 23:45:03
#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 l=sizeof(T);
	static u32 h[l][256]; T *b=new T[n];
	memset(h,0,sizeof(h));
	For(i,0,n-1) For(j,0,l-1) ++h[j][a[i]>>(j*8)&255];
	For(i,0,l-1) For(j,1,255) h[i][j]+=h[i][j-1];
	for(int i=0;i<l;i+=2) {
		rFor(i,n-1,0) b[--h[i][a[i]>>(i*8)&255]]=a[i];
		rFor(i,n-1,0) a[--h[i+1][b[i]>>(i*8+8)&255]]=b[i];
	}
	delete[] b;
}
void sort(u32 *a,int n) {
	bsort(a,n);
}

CompilationN/AN/ACompile OKScore: N/A

Testcase #1955.62 ms40 KBRuntime ErrorScore: 0


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