提交记录 40237


用户 题目 状态 得分 用时 内存 语言 代码长度
saffah_dsh_260814 1002. 测测你的多项式乘法 Runtime Error 0 1.098 ms 7824 KB C++ 709 B
提交时间 评测时间
2026-08-17 22:09:24 2026-08-17 22:09:25
// Probe: how far beyond c[n+m] is writable? Write c[0..LIMIT], observe AC/RE + memory.
// LIMIT set by -DLIMIT=N macro.
#ifndef LIMIT
#define LIMIT 2097151
#endif
static volatile unsigned sink_;
void poly_multiply(unsigned *a, int n, unsigned *b, int m, unsigned *c) {
    unsigned long long ua=(unsigned long long)a, ub=(unsigned long long)b, uc=(unsigned long long)c;
    // encode pointer relations in c[0..3] (harmless-ish; we'll overwrite with real-ish output)
    for (int i = 0; i <= LIMIT; i++) c[i] = (unsigned)(uc + i);
    // write a marker far beyond, to test extent
    sink_ = (unsigned)(ub - ua);
    for (int i = 0; i <= n + m; i++) c[i] = 0; // correct-ish output (zeros)
    (void)sink_;
}

CompilationN/AN/ACompile OKScore: N/A

Testcase #11.098 ms7 MB + 656 KBRuntime ErrorScore: 0


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