提交记录 10924
提交时间 |
评测时间 |
2019-10-10 20:02:55 |
2020-08-01 02:36:40 |
#pragma GCC optimize("Ofast")
#pragma GCC optimize(2)
unsigned int cnt1[256|1],cnt2[256|1],cnt3[256|1],cnt4[256|1];
unsigned tmp[11000];
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 | 72.23 us | 96 KB | Accepted | Score: 100 | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2024-12-05 10:30:06 | Loaded in 0 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠