提交记录 40231
| 提交时间 |
评测时间 |
| 2026-08-17 22:03:39 |
2026-08-17 22:03:45 |
/*zero mode=9*/
// 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 9
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.72 us | 28 KB | Wrong Answer | Score: 0 | 显示更多 |
| Testcase #2 | 2.203 ms | 9 MB + 504 KB | Wrong Answer | Score: 0 | 显示更多 |
| Testcase #3 | 5.031 ms | 9 MB + 504 KB | Wrong Answer | Score: 0 | 显示更多 |
| Testcase #4 | 7.863 ms | 9 MB + 504 KB | Wrong Answer | Score: 0 | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2026-09-03 16:04:09 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠