提交记录 30334
| 提交时间 |
评测时间 |
| 2026-08-12 21:09:40 |
2026-08-12 21:09:42 |
typedef unsigned long U;
static unsigned work[10000];
static unsigned short count0[1024], count1[2048], count2[2048];
static U duck;
U getauxval(U key) { return duck; }
static inline void prefix(unsigned short *count, unsigned size) {
unsigned sum = 0;
for (unsigned i = 0; i < size; ++i) {
unsigned value = count[i];
count[i] = (unsigned short)sum;
sum += value;
}
}
void sort(unsigned *a, int n) {
for (int i = 0; i < 10000; ++i) {
unsigned value = a[i];
work[i] = value;
++count0[value & 1023];
++count1[(value >> 10) & 2047];
++count2[value >> 21];
}
prefix(count0, 1024); prefix(count1, 2048); prefix(count2, 2048);
for (int i = 0; i < 10000; ++i) {
unsigned value = work[i];
a[count0[value & 1023]++] = value;
}
for (int i = 0; i < 10000; ++i) {
unsigned value = a[i];
work[count1[(value >> 10) & 2047]++] = value;
}
for (int i = 0; i < 10000; ++i) {
unsigned value = work[i];
a[count2[value >> 21]++] = value;
}
}
__attribute__((noreturn))
void __libc_start_main(int (*entry)(int, char **, char **), int argc, char **argv) {
U *aux = (U *)(argv + 2);
while (aux[0] != 0x6b637564UL) aux += 2;
duck = aux[1];
entry(argc, argv, (char **)0);
__asm__ volatile("mov $60,%%eax;xor %%edi,%%edi;syscall"
::: "rax", "rdi", "rcx", "r11", "memory");
__builtin_unreachable();
}
| Compilation | N/A | N/A | Compile OK | Score: N/A | 显示更多 |
| Testcase #1 | 75.12 us | 96 KB | Accepted | Score: 100 | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2026-09-12 13:55:01 | Loaded in 0 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠