What can really cause such a runtime error with this version of the GNU C++ compiler? The only thing I thought about was a bug in this version, which was fixed later in GNU C++17.
- My accepted submission with GNU C++17: https://mirror.codeforces.com/contest/1696/submission/169228991
- The submission with the same code but with GNU C++14: https://mirror.codeforces.com/contest/1696/submission/169229016
I tried all different versions and C++ compilers but it only passed with GNU C++20 (64) and GNU C++17. The weird is that it didn't pass with GNU C++17 (64).