提交记录 1027
提交时间 |
评测时间 |
2018-06-20 18:28:14 |
2020-07-31 20:45:46 |
int c0[300], c1[300], c2[300], c3[300];
unsigned bi[10005];
void sort(unsigned *a, int n)
{
unsigned *ai = a;
for (register int i = 0; i < n; ++ i)
{
c0[ai[i] & 255] ++;
c1[(ai[i] >> 8) & 255] ++;
c2[(ai[i] >> 16) & 255] ++;
c3[ai[i] >> 24] ++;
}
for (int i = 1; i < 256; ++ i) c0[i] += c0[i - 1];
for (int i = 1; i < 256; ++ i) c1[i] += c1[i - 1];
for (int i = 1; i < 256; ++ i) c2[i] += c2[i - 1];
for (int i = 1; i < 256; ++ i) c3[i] += c3[i - 1];
for (register int i = n - 1; ~i; -- i) bi[-- c0[ai[i] & 255]] = ai[i];
for (register int i = n - 1; ~i; -- i) ai[-- c1[(bi[i] >> 8) & 255]] = bi[i];
for (register int i = n - 1; ~i; -- i) bi[-- c2[(ai[i] >> 16) & 255]] = ai[i];
for (register int i = n - 1; ~i; -- i) ai[-- c3[bi[i] >> 24]] = bi[i];
}
Compilation | N/A | N/A | Compile OK | Score: N/A | 显示更多 |
Testcase #1 | 72.5 us | 92 KB | Accepted | Score: 100 | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2024-12-05 10:06:04 | Loaded in 0 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠