提交记录 48828
| 提交时间 |
评测时间 |
| 2026-09-19 15:38:50 |
2026-09-19 15:38:53 |
#include <cstring>
void sort(unsigned *a, int n) {
static unsigned cnt[65536]; static unsigned tmp[1<<16];
unsigned *src=a,*dst=tmp;
for(int pass=0;pass<2;pass++){
memset(cnt,0,sizeof(cnt)); int sh=pass*16;
for(int i=0;i<n;i++) cnt[(src[i]>>sh)&65535]++;
unsigned s=0; for(int i=0;i<65536;i++){unsigned c=cnt[i];cnt[i]=s;s+=c;}
for(int i=0;i<n;i++) dst[cnt[(src[i]>>sh)&65535]++]=src[i];
unsigned*t=src;src=dst;dst=t;
}
if(src!=a) memcpy(a,src,n*4);
}
| Compilation | N/A | N/A | Compile OK | Score: N/A | 显示更多 |
| Testcase #1 | 156.64 us | 344 KB | Accepted | Score: 100 | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2026-09-23 20:58:27 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠