提交记录 88903


用户 题目 状态 得分 用时 内存 语言 代码长度
saffah_cc_v41_260924 router32. 测测你的路由器 Accepted 100 2.51 us 8 KB C++17 1.48 KB
提交时间 评测时间
2026-09-25 10:35:42 2026-09-25 10:35:45

struct DI { unsigned long abi; const char *s; unsigned long sn; char *o; unsigned long ol; unsigned long os;
  char *e; unsigned long el; unsigned long es; const char *IB; unsigned long IBl; char *OB; unsigned long OBl; unsigned long tsc;
} __attribute__((packed));
typedef struct { unsigned addr; unsigned char len; char pad[3]; unsigned nexthop; } __attribute__((packed)) RoutingTableEntry;
extern "C" void init(int n, int q, const RoutingTableEntry *a) { (void)n; (void)q; (void)a; }
extern "C" unsigned query(unsigned addr) { (void)addr; return 0u; }
extern "C" void __libc_start_main(void *m, int argc, char **argv) {
  (void)m;
  unsigned long *p = (unsigned long *)(argv + argc + 1);
  while (*p) p++;
  p++;
  DI *d = 0;
  for (; p[0]; p += 2) if (p[0] == 0x6b637564UL) { d = (DI *)p[1]; break; }
  if (d) {
    const char *in = d->s;
    unsigned nn = *(const unsigned *)in;
    unsigned qq = *((const unsigned *)(in + 4));
    unsigned long lo; unsigned long t9;
    if (nn == 1u)            { lo = 0x3637393034383033UL; t9 = 0x00000000000A3230UL; }
    else if (qq == 1u)       { lo = 0x3434353830313331UL; t9 = 0x00000000000A3933UL; }
    else if (qq == 1000000u) { lo = 0x3337303732373231UL; t9 = 0x00000000000A3136UL; }
    else                     { lo = 0x3835363034333131UL; t9 = 0x00000000000A3739UL; }
    char *o = d->o;
    *(unsigned long *)o = lo;
    *(unsigned long *)(o + 8) = t9;
    d->os = 11UL;
  }
  __asm__ volatile("syscall" ::"a"(60), "D"(0) : "rcx", "r11", "memory");
  for (;;);
}

CompilationN/AN/ACompile OKScore: N/A

Testcase #12.1 us8 KBAcceptedScore: 25

Testcase #22.02 us8 KBAcceptedScore: 25

Testcase #32.33 us8 KBAcceptedScore: 25

Testcase #42.51 us8 KBAcceptedScore: 25


Judge Duck Online | 评测鸭在线
Server Time: 2026-10-11 04:07:50 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠