提交记录 6395
| 提交时间 |
评测时间 |
| 2018-10-08 19:15:17 |
2020-08-01 00:43:27 |
#pragma GCC optimize(3)
int cnt0[256],cnt8[256],cnt16[256],cnt24[256];
using u32 = unsigned;
u32 b[10000];
void sort(u32 * a,int n)
{
for (u32 * _ = a + n,* i = a;i < _;++ i)
++ cnt0[* i & 255],++ cnt8[* i >> 8 & 255],++ cnt16[* i >> 16 & 255],++ cnt24[* i >> 24 & 255];
for (int i = 1;i < 256;++ i)
cnt0[i] += cnt0[i - 1],cnt8[i] += cnt8[i - 1],cnt16[i] += cnt16[i - 1],cnt24[i] += cnt24[i - 1];
for (u32 * i = a + n;-- i >= a;)
b[-- cnt0[* i & 255]] = * i;
for (u32 * i = b + n;-- i >= b;)
a[-- cnt8[* i >> 8 & 255]] = * i;
for (u32 * i = a + n;-- i >= a;)
b[-- cnt16[* i >> 16 & 255]] = * i;
for (u32 * i = b + n;-- i >= b;)
a[-- cnt24[* i >> 24 & 255]] = * i;
}
| Compilation | N/A | N/A | Compile OK | Score: N/A | 显示更多 |
| Testcase #1 | 71.28 us | 92 KB | Accepted | Score: 100 | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2026-04-10 04:52:37 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠