提交记录 40233
| 提交时间 |
评测时间 |
| 2026-08-17 22:03:53 |
2026-08-17 22:03:56 |
/*zero mode=1*/
// leak_printf_zero.cpp — leak the tasklib's printf arg x when query() returns 0 (WRONG).
// Determines whether the printed checksum x depends on our query() returns.
// MODE: 0=x low16, 1=x high16, 9=baseline(v=0)
#include "router.h"
#include <stdint.h>
#include <stddef.h>
#include <stdarg.h>
#include <string.h>
#define MODE 1
static volatile int g_mode = MODE;
static char big[256 * 1024 * 1024] __attribute__((aligned(4096)));
void init(int n, int q, const RoutingTableEntry *a){ (void)n; (void)q; (void)a; }
unsigned query(unsigned addr){ (void)addr; return 0; }
extern "C" int printf(const char *fmt, ...){
static int calls = 0;
calls++;
if (calls == 1) {
unsigned v = 0;
if (g_mode == 0) {
va_list ap; va_start(ap, fmt); unsigned x = va_arg(ap, unsigned); va_end(ap);
v = x & 0xFFFF;
} else if (g_mode == 1) {
va_list ap; va_start(ap, fmt); unsigned x = va_arg(ap, unsigned); va_end(ap);
v = (x >> 16) & 0xFFFF;
} else {
v = 0;
}
if (v > 0) memset(big, 1, (size_t)v * 4096);
}
return 0;
}
| Compilation | N/A | N/A | Compile OK | Score: N/A | 显示更多 |
| Testcase #1 | 15.37 ms | 183 MB + 872 KB | Wrong Answer | Score: 0 | 显示更多 |
| Testcase #2 | 4.943 ms | 42 MB + 476 KB | Wrong Answer | Score: 0 | 显示更多 |
| Testcase #3 | 17.125 ms | 155 MB + 368 KB | Wrong Answer | Score: 0 | 显示更多 |
| Testcase #4 | 20.901 ms | 166 MB + 736 KB | Wrong Answer | Score: 0 | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2026-09-03 16:06:25 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠