提交记录 2593
| 提交时间 |
评测时间 |
| 2018-06-27 23:34:07 |
2020-07-31 21:04:34 |
void swap(unsigned *a, unsigned *b)
{
unsigned t = *a; *a = *b; *b = t;
}
unsigned output[100000000], mx = 0, sta[10];
void sort(unsigned *a, int n)
{
for(unsigned i = 0; i < n; i ++)
mx = (mx < a[i]) ? a[i] : mx;
for(unsigned x = 1; mx > 0; mx /= 10, x *= 10)
{
memset(sta, 0, sizeof(sta));
for(unsigned i = 0; i < n; i ++)
sta[(a[i] / x) % 10] ++;
for(unsigned i = 1; i < 10; i ++)
sta[i] += sta[i - 1];
for(unsigned i = n - 1; i >= 0; i --)
output[sta[(a[i] / x) % 10] - 1] = a[i], sta[(a[i] / x) % 10] --;
for(unsigned i = 0; i < n; i ++)
a[i] = output[i];
}
}
| Compilation | N/A | N/A | Compile Error | Score: N/A | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2026-04-20 07:01:48 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠