提交记录 19875
提交时间 |
评测时间 |
2023-08-11 16:32:07 |
2023-08-11 16:32:12 |
#include<bits/stdc++.h>
void sort(unsigned *a,int n)
{
unsigned *b=new unsigned[n],*cnt=new unsigned[256];
memset(cnt,0,1024);
for(int j=0; j<=n-1; ++j) ++cnt[a[j]&255];
for(int j=1; j<256; ++j) cnt[j]+=cnt[j-1];
for(int j=n-1; j>=0; --j) b[--cnt[a[j]&255]]=a[j];
memset(cnt,0,1024);
for(int j=0; j<=n-1; ++j) ++cnt[b[j]>>8&255];
for(int j=1; j<256; ++j) cnt[j]+=cnt[j-1];
for(int j=n-1; j>=0; --j) a[--cnt[b[j]>>8&255]]=b[j];
memset(cnt,0,1024);
for(int j=0; j<=n-1; ++j) ++cnt[a[j]>>16&255];
for(int j=1; j<256; ++j) cnt[j]+=cnt[j-1];
for(int j=n-1; j>=0; --j) b[--cnt[a[j]>>16&255]]=a[j];
memset(cnt,0,1024);
for(int j=0; j<=n-1; ++j) ++cnt[b[j]>>24&255];
for(int j=1; j<256; ++j) cnt[j]+=cnt[j-1];
for(int j=n-1; j>=0; --j) a[--cnt[b[j]>>24&255]]=b[j];
}
Compilation | N/A | N/A | Compile OK | Score: N/A | 显示更多 |
Testcase #1 | 1.06 ms | 812 KB | Accepted | Score: 34 | 显示更多 |
Testcase #2 | 1.146 s | 762 MB + 992 KB | Accepted | Score: 33 | 显示更多 |
Testcase #3 | 2.296 s | 1525 MB + 928 KB | Accepted | Score: 33 | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2025-09-14 11:27:50 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠