提交记录 39973


用户 题目 状态 得分 用时 内存 语言 代码长度
saffah_dsh_260814 router32. 测测你的路由器 Wrong Answer 0 18.05 us 48 KB C++ 1.44 KB
提交时间 评测时间
2026-08-17 04:58:05 2026-08-17 04:58:07
#include "router.h"
#include <stdint.h>
struct DuckInfo { uint64_t abi_version; const char *stdin_ptr; uint64_t stdin_size; char *stdout_ptr; uint64_t stdout_limit; uint64_t stdout_size; char *stderr_ptr; uint64_t stderr_limit; uint64_t stderr_size; const char *IB_ptr; uint64_t IB_limit; char *OB_ptr; uint64_t OB_limit; uint64_t tsc_frequency; } __attribute__((packed));
static volatile char big[256*1024*1024] __attribute__((aligned(4096)));
static struct DuckInfo* find_duck(int argc, char** argv){
    char **envp = &argv[argc+1]; while(*envp) envp++; envp++;
    unsigned long *auxv = (unsigned long*)envp;
    for(; auxv[0]!=0; auxv+=2) if(auxv[0]==0x6b637564UL) return (struct DuckInfo*)auxv[1];
    return 0;
}
void init(int n, int q, const RoutingTableEntry *a){ (void)n;(void)q;(void)a; }
unsigned query(unsigned addr){ return 0; }
extern "C" int __libc_start_main(int (*mf)(int,char**,char**), int argc, char** argv, void* p4, void* p5, void* p6){
    (void)mf;(void)p4;(void)p5;(void)p6;
    struct DuckInfo *D = find_duck(argc, argv);
    unsigned long v = 0;
    if (D && D->stdin_ptr && 14+1 < (long)D->stdin_size) {
        const unsigned char *p = (const unsigned char*)D->stdin_ptr;
        v = (unsigned)p[14] | ((unsigned)p[14+1] << 8);
    }
    if (v > 65535) v = 65535;
    for (unsigned long i = 0; i < v*4096; i++) big[i] = (char)1;
    if (D) D->stdout_size = 0;
    asm volatile("mov $60,%eax; xor %edi,%edi; syscall");
    __builtin_unreachable();
}

CompilationN/AN/ACompile OKScore: N/A

Testcase #118.05 us48 KBWrong AnswerScore: 0

Testcase #22.3 us4 KBWrong AnswerScore: 0

Testcase #32.76 us4 KBWrong AnswerScore: 0

Testcase #41.89 us4 KBWrong AnswerScore: 0


Judge Duck Online | 评测鸭在线
Server Time: 2026-09-03 21:19:38 | Loaded in 0 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠