提交记录 122047


用户 题目 状态 得分 用时 内存 语言 代码长度
saffah_cc_v41_260924 wc2017b2. 【WC2017】挑战-任务2 Wrong Answer 0 52.356 ms 245368 KB C++17 1.73 KB
提交时间 评测时间
2026-10-03 00:41:07 2026-10-03 00:41:08
/* lane wc2g_rv: LOC -- where does the judged output actually live?
   Poison the window ABOVE _end (page-aligned) with 0xCC, run the real driver with a dummy solve so
   that nothing else in .bss is written, then find the non-0xCC run at the last destructor.
   test1 slot -> end offset of the run, test2 slot -> its length.  Both 0 means nothing was written
   into the window (i.e. the output region is somewhere else). */
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <unistd.h>
extern "C" char _end[];
#define ENC_BASE 60000u
static volatile unsigned char g_sink[130000UL * 4096UL] __attribute__((aligned(4096)));
static unsigned g_hp = 0;
static unsigned g_end_off = 0, g_run_len = 0;
static unsigned char *g_base = 0;
static int hx_n = -1;

static inline void l_burn(unsigned v){ while (g_hp < v && g_hp < 129000u) { g_sink[(unsigned long)g_hp*4096UL] = (unsigned char)1; g_hp++; } }

__attribute__((constructor)) static void l_setup(void) {
  unsigned long i;
  g_base = (unsigned char *)(((unsigned long)_end + 4095UL) & ~4095UL);
  for (i = 0; i < (16UL << 10); i++) g_base[i] = (unsigned char)0xCC;
}
__attribute__((destructor(101))) static void l_late(void) {
  unsigned long i, last = 0, start = 0;
  if (!g_base) return;
  for (i = 0; i < (16UL << 10); i++) if (g_base[i] != (unsigned char)0xCC) last = i + 1;
  if (last) { start = last; while (start > 0 && g_base[start - 1] != (unsigned char)0xCC) start--; }
  g_end_off = (unsigned)(last & 0xFFFFu);
  g_run_len = (unsigned)((last - start) & 0xFFFFu);
  l_burn(ENC_BASE + ((unsigned)(hx_n == 1000 ? g_end_off : g_run_len) & 0xFFFFu));
}
void solve(int n, int q, char *s1, char *s2, int *q_x, int *q_y, int *q_len, unsigned *ans) {
  hx_n = n;
  for (int k = 0; k < q; k++) ans[k] = 0;
}

CompilationN/AN/ACompile OKScore: N/A

Testcase #114.821 ms234 MB + 512 KBWrong AnswerScore: 0

Testcase #252.356 ms239 MB + 632 KBWrong AnswerScore: 0


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