提交记录 10928
提交时间 |
评测时间 |
2019-10-10 21:09:54 |
2020-08-01 02:36:46 |
unsigned int cnt1[256|10],cnt2[256|10],cnt3[256|10],cnt4[256|10];
unsigned tmp[(int)1e8+100];
void sort(unsigned *a,int n)
{
--a;
for(register int i=1;i<=n;++i)
++cnt1[a[i]&0xff],
++cnt2[a[i]>>8&0xff],
++cnt3[a[i]>>16&0xff],
++cnt4[a[i]>>24&0xff];
for(register int i=1;i<256;++i)
cnt1[i]+=cnt1[i-1],
cnt2[i]+=cnt2[i-1],
cnt3[i]+=cnt3[i-1],
cnt4[i]+=cnt4[i-1];
for(register int i=n;i;--i)tmp[cnt1[a[i]&0xff]--]=a[i];
for(register int i=n;i;--i)a[cnt2[tmp[i]>>8&0xff]--]=tmp[i];
for(register int i=n;i;--i)tmp[cnt3[a[i]>>16&0xff]--]=a[i];
for(register int i=n;i;--i)a[cnt4[tmp[i]>>24&0xff]--]=tmp[i];
}
Compilation | N/A | N/A | Compile OK | Score: N/A | 显示更多 |
Testcase #1 | 819.775 ms | 762 MB + 976 KB | Accepted | Score: 100 | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2024-04-20 08:29:39 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用