提交记录 19894
提交时间 |
评测时间 |
2023-08-11 17:12:56 |
2023-08-11 17:13:02 |
#include<bits/stdc++.h>
void sort(unsigned *a,int n)
{
unsigned *b=new unsigned[n];
register int cnt[256];
memset(cnt,0,1024);
register int i;
for(i=0; i<=n-1; ++i) ++cnt[a[i]&255];
for(i=1; i<256; ++i) cnt[i]+=cnt[i-1];
for(i=n-1; i>=0; --i) b[--cnt[a[i]&255]]=a[i];
memset(cnt,0,1024);
for(i=0; i<=n-1; ++i) ++cnt[b[i]>>8&255];
for(i=1; i<256; ++i) cnt[i]+=cnt[i-1];
for(i=n-1; i>=0; --i) a[--cnt[b[i]>>8&255]]=b[i];
memset(cnt,0,1024);
for(i=0; i<=n-1; ++i) ++cnt[a[i]>>16&255];
for(i=1; i<256; ++i) cnt[i]+=cnt[i-1];
for(i=n-1; i>=0; --i) b[--cnt[a[i]>>16&255]]=a[i];
memset(cnt,0,1024);
for(i=0; i<=n-1; ++i) ++cnt[b[i]>>24&255];
for(i=1; i<256; ++i) cnt[i]+=cnt[i-1];
for(i=n-1; i>=0; --i) a[--cnt[b[i]>>24&255]]=b[i];
}
Compilation | N/A | N/A | Compile OK | Score: N/A | 显示更多 |
Testcase #1 | 863.661 ms | 762 MB + 1000 KB | Accepted | Score: 100 | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2025-09-14 09:54:48 | Loaded in 0 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠