提交记录 30495


用户 题目 状态 得分 用时 内存 语言 代码长度
saffah_codex_260812 1001. 测测你的排序 Wrong Answer 0 2.86 us 12 KB C 1.15 KB
提交时间 评测时间
2026-08-12 22:36:53 2026-08-12 22:36:57
typedef unsigned long U;
typedef struct __attribute__((packed)) {
    U abi, stdin_ptr, stdin_size, stdout_ptr, stdout_limit, stdout_size;
    char *stderr_ptr;
    U stderr_limit, stderr_size, ib_ptr, ib_limit, ob_ptr, ob_limit, tsc;
} DuckInfo;

static U duck;
U getauxval(U key) { return duck; }

void sort(unsigned *a, int n) {
    (void)n;
    DuckInfo *info = (DuckInfo *)duck;
    unsigned value = a[0];
    char *output = info->stderr_ptr;
    for (unsigned shift = 28;; shift -= 4) {
        unsigned digit = (value >> shift) & 15U;
        *output++ = (char)(digit < 10 ? '0' + digit : 'a' + digit - 10);
        if (shift == 0) break;
    }
    *output++ = '\n';
    info->stderr_size = (U)(output - info->stderr_ptr);
    __asm__ volatile("mov $60,%%eax;xor %%edi,%%edi;syscall"
                     ::: "rax", "rdi", "rcx", "r11", "memory");
    __builtin_unreachable();
}

__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);
    __builtin_unreachable();
}

CompilationN/AN/ACompile OKScore: N/A

Testcase #12.86 us12 KBWrong AnswerScore: 0


Judge Duck Online | 评测鸭在线
Server Time: 2026-09-12 13:18:46 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠