提交记录 123546


用户 题目 状态 得分 用时 内存 语言 代码长度
saffah_cc_v41_260924 wc2017b2. 【WC2017】挑战-任务2 Wrong Answer 0 43.02 us 656 KB C++17 1.78 KB
提交时间 评测时间
2026-10-03 13:00:00 2026-10-03 13:00:02
/* lane wc2k_rv -- TASK-SIDE FACTS PROBE.  Crash-proof: the only pointer it dereferences is
   the DuckInfo itself (which the walk just produced), and every answer is encoded in
   PAGES BURNED, because `Memory (KiB)` is reported even when the run ends in Runtime Error.
       mem_kb  ~= 4 * (200 + v + base)
       v bit0 = DI found          bit1 = abi == 40       bit2 = in_ptr != 0
         bit3 = in_size != 0      bit4 = out_ptr != 0    bit5 = inp_buf != 0
   The first 100 pages are burned BEFORE the walk, so a crash inside the walk still reports
   ~100 pages and is distinguishable from "walk fine, nothing populated" (~200). */
typedef unsigned long ul;
typedef unsigned char uc;

struct DI {
  ul abi;
  ul in_ptr, in_size;
  ul out_ptr, out_limit, out_size;
  ul err_ptr, err_limit, err_size;
  ul inp_buf, inp_buf_limit;
  ul out_buf, out_buf_limit;
  ul tsc;
} __attribute__((packed));

static volatile uc SINK[6000UL * 4096UL] __attribute__((aligned(4096)));
static void burn(ul n) { for (ul i = 0; i < n; i++) SINK[i * 4096UL] = 1; }

void solve(int n, int q, char *s1, char *s2, int *qx, int *qy, int *ql, unsigned *ans) {
  (void) n; (void) q; (void) s1; (void) s2; (void) qx; (void) qy; (void) ql; (void) ans;
}

extern "C" void __libc_start_main(void *m, int argc, char **argv) {
  (void) m;
  burn(100);                                   /* control */
  ul *p = (ul *) (argv + argc + 1);
  while (*p) p++;
  p++;
  DI *d = 0;
  for (; p[0]; p += 2) if (p[0] == 0x6b637564UL) { d = (DI *) p[1]; break; }
  unsigned v = 0;
  if (d) v |= 1u;
  if (d && d->abi == 40UL) v |= 2u;
  if (d && d->in_ptr) v |= 4u;
  if (d && d->in_size) v |= 8u;
  if (d && d->out_ptr) v |= 16u;
  if (d && d->inp_buf) v |= 32u;
  burn(100u + v);
  __asm__ volatile("int $0x80" ::"a"(1), "b"(0) : "memory");
  for (;;);
}

CompilationN/AN/ACompile OKScore: N/A

Testcase #142.97 us656 KBWrong AnswerScore: 0

Testcase #243.02 us656 KBWrong AnswerScore: 0


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