Hello guys,
https://codeforces.net/contest/1324/submission/73157058 fails at test 99 because of this
Diagnostics detected issues [cpp.g++17-drmemory]: Dr,2020-03-13.M Dr. Memory version 1.11.0 Dr,2020-03-13.M Running "program.exe"
This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information. C:/Programs/mingw-w64-7/lib/gcc/i686-w64-mingw32/7.3.0/include/c++/debug/vector:417: Error: attempt to subscript container with out-of-bounds index 2, but container only holds 2 elements.
Objects involved in the operation: sequence "this" @ 0x00300060 { type = std::__debug::vector<int, std::allocator >; } Dr,2020-03-13.M Dr,2020-03-13.M NO ERRORS FOUND: Dr,2020-03-13.M 0 unique, 0 total unaddressable access(es) Dr,2020-03-13.M 0 unique, 0 total uninitialized access(es) Dr,2020-03-13.M 0 unique, 0 total invalid heap argument(s) Dr,2020-03-13.M 0 unique, 0 total GDI usage error(s) Dr,2020-03-13.M 0 unique, 0 total handle leak(s) Dr,2020-03-13.M 0 unique, 0 total warning(s) Dr,2020-03-13.M 0 unique, 0 total, 0 byte(s) of leak(s) Dr,2020-03-13.M 0 unique, 0 total, 0 byte(s) of possible leak(s) Dr,2020-03-13.M ERRORS IGNORED: Dr,2020-03-13.M 2 potential error(s) (suspected false positives) Dr,2020-03-13.M (details: K:\invoker-prod\work\codeforces6\1843d7698c4806cf9d85184a84ec46ea\check-7d3733f84f4a8e2ab0065b77fcdbaa35\run\DrMemory-program.exe.4504.000\potential_errors.txt) Dr,2020-03-13.M 18 unique, 36 total, 168416 byte(s) of still-reachable allocation(s) Dr,2020-03-13.M (re-run with "-show_reachable" for details) Dr,2020-03-13.M Details: K:\invoker-prod\work\codeforces6\1843d7698c4806cf9d85184a84ec46ea\check-7d3733f84f4a8e2ab0065b77fcdbaa35\run\DrMemory-program.exe.4504.000\results.txt Dr,2020-03-13.M WARNING: application exited with abnormal code 0x3
But this works fine in local compiler for the same test case. can anybody point out my mistake?
Thanks!
It does tell you the error!
The reason you index out of bounds is because you have an error on this line
the check should have been