提交记录 2602
| 提交时间 |
评测时间 |
| 2018-06-28 00:14:08 |
2020-07-31 21:04:41 |
void swap(unsigned *a, unsigned *b)
{
unsigned t = *a; *a = *b; *b = t;
}
int mx = 0, sta[10];
unsigned output[100000000];
void sort(unsigned *a, int n)
{
for(int i = 0; i < n; i ++)
mx = (mx < a[i]) ? a[i] : mx;
for(int x = 1; mx > 0; mx /= 10, x *= 10)
{
sta[0] = sta[1] = sta[2] = sta[3] = sta[4] = sta[5] = sta[6] = sta[7] = sta[8] = sta[9] = 0;
for(int i = 0; i < n; i ++)
sta[(a[i] / x) % 10] ++;
for(int i = 1; i < 10; i ++)
sta[i] += sta[i - 1];
for(int i = n - 1; i >= 0; i --)
output[sta[(a[i] / x) % 10] - 1] = a[i], sta[(a[i] / x) % 10] --;
for(int 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:12:01 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠