提交记录 6389
| 用户 |
题目 |
状态 |
得分 |
用时 |
内存 |
语言 |
代码长度 |
| temp6 |
1001. 测测你的排序 |
Accepted |
100 |
822.051 ms |
781264 KB |
C++ |
663 B |
| 提交时间 |
评测时间 |
| 2018-10-08 18:53:37 |
2020-08-01 00:43:23 |
int cnt0[256],cnt8[256],cnt16[256],cnt24[256];
using u32 = unsigned;
u32 b[100000000];
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 | 822.051 ms | 762 MB + 976 KB | Accepted | Score: 100 | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2026-04-10 04:49:43 | Loaded in 0 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠