提交记录 40232
| 提交时间 |
评测时间 |
| 2026-08-17 22:03:48 |
2026-08-17 22:03:51 |
/*zero mode=0*/
// 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 0
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 | 12.735 ms | 152 MB + 292 KB | Wrong Answer | Score: 0 | 显示更多 |
| Testcase #2 | 18.582 ms | 204 MB + 876 KB | Wrong Answer | Score: 0 | 显示更多 |
| Testcase #3 | 8.753 ms | 53 MB + 920 KB | Wrong Answer | Score: 0 | 显示更多 |
| Testcase #4 | 19.874 ms | 154 MB + 320 KB | Wrong Answer | Score: 0 | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2026-09-03 16:05:24 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠