提交记录 9452
| 提交时间 |
评测时间 |
| 2019-05-11 14:51:06 |
2020-08-01 01:38:24 |
unsigned tmp[100000001];
void sort(unsigned *a, int n) {
unsigned *cnt1=new unsigned[257], *cnt2=new unsigned[257], *cnt3=new unsigned[257], *cnt4=new unsigned[257];
register unsigned *ae = a + n + 1, *tmpe = tmp + n + 1;
register unsigned *cnte1 = cnt1 + 257, *cnte2 = cnt2 + 257, *cnte3 = cnt3 + 257, *cnte4 = cnt4 + 257;
for(register unsigned *i = a + 1; i != ae; ++i)
++cnt1[*i & 0xff];
for(register unsigned *i = cnt1 + 1; i != cnte1; ++i)
*i += *(i - 1);
for(register unsigned *i = ae - 1; i != a; --i)
tmp[cnt1[*i & 0xff]--] = *i;
for(register unsigned *i = tmp + 1; i != tmpe; ++i)
++cnt2[(*i >> 8) & 0xff];
for(register unsigned *i = cnt2 + 1; i != cnte2; ++i)
*i += *(i - 1);
for(register unsigned *i = tmpe - 1; i != tmp; --i)
a[cnt2[(*i >> 8) & 0xff]--] = *i;
for(register unsigned *i = a + 1; i != ae; ++i)
++cnt3[(*i >> 16) & 0xff];
for(register unsigned *i = cnt3 + 1; i != cnte3; ++i)
*i += *(i - 1);
for(register unsigned *i = ae - 1; i != a; --i)
tmp[cnt3[(*i >> 16) & 0xff]--] = *i;
for(register unsigned *i = tmp + 1; i != tmpe; ++i)
++cnt4[(*i >> 24) & 0xff];
for(register unsigned *i = cnt4 + 1; i != cnte4; ++i)
*i += *(i - 1);
for(register unsigned *i = tmpe - 1; i != tmp; --i)
a[cnt4[(*i >> 24) & 0xff]--] = *i;
}
| Compilation | N/A | N/A | Compile OK | Score: N/A | 显示更多 |
| Testcase #1 | 877.142 ms | 762 MB + 984 KB | Wrong Answer | Score: 0 | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2026-04-04 06:45:35 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠