疑惑记录: g++错了?

疑惑记录: g++错了?

起因

放假了!来刷点cf A,B,C题轻松轻松.结果
Wrong answer on test 2 △  ⁣ ⁣ ⁣ ! \triangle\!\!\!! !

经过

Checker Log

wrong answer 3421st numbers differ - expected: '4999999999', found: '2147483646'

看到这个错误结果的第一反应是 2 31 − 2 2^{31}-2 2312,果然需要long long
但是
Diagnostics

Diagnostics detected issues [cpp.g++17-drmemory]: ~~Dr.M~~ Dr. Memory version 1.11.0
~~Dr.M~~ Running "b5fd26c7d19d5859b700a557341455a3.exe"
~~Dr.M~~ 
~~Dr.M~~ Error #1: UNINITIALIZED READ: reading register edx
~~Dr.M~~ # 0 solve               [K:\ramdisk\codeforces61\4ad8d721dae2d53b30b8687338872543\compile-c0fafa8301f543b35bf9a11810ece84d/p71.cpp:10]
~~Dr.M~~ # 1 main                [K:\ramdisk\codeforces61\4ad8d721dae2d53b30b8687338872543\compile-c0fafa8301f543b35bf9a11810ece84d/p71.cpp:18]
~~Dr.M~~ Note: @0:00:00.424 in thread 5072
~~Dr.M~~ Note: instruction: cmp    %edx %eax
~~Dr.M~~ 
~~Dr.M~~ TERMINATING PROCESS after first error found
~~Dr.M~~ 
~~Dr.M~~ ERRORS FOUND:
~~Dr.M~~       0 unique,     0 total unaddressable access(es)
~~Dr.M~~       1 unique,     1 total uninitialized access(es)
~~Dr.M~~       0 unique,     0 total invalid heap argument(s)
~~Dr.M~~       0 unique,     0 total GDI usage error(s)
~~Dr.M~~       0 unique,     0 total handle leak(s)
~~Dr.M~~       0 unique,     0 total warning(s)
~~Dr.M~~       0 unique,     0 total,      0 byte(s) of leak(s)
~~Dr.M~~       0 unique,     0 total,      0 byte(s) of possible leak(s)
~~Dr.M~~ ERRORS IGNORED:
~~Dr.M~~       2 potential error(s) (suspected false positives)
~~Dr.M~~          (details: K:\ramdisk\codeforces61\4ad8d721dae2d53b30b8687338872543\check-b5b636a8cdb049059bd016b36588ab49\run\DrMemory-b5fd26c7d19d5859b700a557341455a3.exe.4968.000\potential_errors.txt)
~~Dr.M~~      11 unique,    11 total,  24693 byte(s) of still-reachable allocation(s)
~~Dr.M~~          (re-run with "-show_reachable" for details)
~~Dr.M~~ Details: K:\ramdisk\codeforces61\4ad8d721dae2d53b30b8687338872543\check-b5b636a8cdb049059bd016b36588ab49\run\DrMemory-b5fd26c7d19d5859b700a557341455a3.exe.4968.000\results.txt
~~Dr.M~~ WARNING: application exited with abnormal code 0xc0000005

然后cf提示
Uninitialized value usage

结果

  • 我不知道为啥,是我错了,还是g++错了?
  • 还有一个挺好奇的是为什么错误答案是 2 31 − 2 2^{31}-2 2312,感觉就像是给了一个饱和操作一样.
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值