提交记录 21928
提交时间 |
评测时间 |
2024-07-15 12:50:05 |
2024-07-15 12:50:06 |
#define fo(i,x,y) for(int i = x;i <= y;++i)
#define u32 unsigned
u32 B[10010],cnt[310];
void sort(u32 *a,int n)
{
fo(i,0,255) cnt[i] = 0;
for(u32 *i = a;i != a + n;++i) ++cnt[*i & 255];
fo(i,1,255) cnt[i] += cnt[i - 1];
for(u32 *i = a + n - 1;i != a - 1;--i) B[--cnt[*i & 255]] = *i;
fo(i,0,255) cnt[i] = 0;
for(u32 *i = B;i != B + n;++i) ++cnt[*i >> 8 & 255];
fo(i,1,255) cnt[i] += cnt[i - 1];
for(u32 *i = B + n - 1;i != B - 1;--i) a[--cnt[*i >> 8 & 255]] = *i;
fo(i,0,255) cnt[i] = 0;
for(u32 *i = a;i != a + n;++i) ++cnt[*i >> 16 & 255];
fo(i,1,255) cnt[i] += cnt[i - 1];
for(u32 *i = a + n - 1;i != a - 1;--i) B[--cnt[*i >> 16 & 255]] = *i;
fo(i,0,255) cnt[i] = 0;
for(u32 *i = B;i != B + n;++i) ++cnt[*i >> 24 & 255];
fo(i,1,255) cnt[i] += cnt[i - 1];
for(u32 *i = B + n - 1;i != B - 1;--i) a[--cnt[*i >> 24 & 255]] = *i;
}
Compilation | N/A | N/A | Compile OK | Score: N/A | 显示更多 |
Testcase #1 | 75.5 us | 88 KB | Accepted | Score: 100 | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2024-12-05 10:25:57 | Loaded in 0 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠