Hello Codeforces! In yesterday's contest Codeforces Round 651 (Div. 2), on submitting the solution to B problem 1370B - GCD Compression, I encountered a Runtime Error on Pretest 1, when I submitted with GNU G++ 14 as the programming language. On my Sublime Text 3, it was working fine. Then, I tried submitting with GNU G++ 17(64 bit), and it got accepted. Have a look at my code: 84470670. Please help me in finding which line arose the error in GNU G++ 14 programming language and what is the basic difference between the two versions. Also, which one should I use as my default language? Thanks in advance!
ll sz1 = odd.size() - 1; ll sz2 = even.size() - 1;
.size() — 1 returns an unsigned int
You should cast .size() to int first
You can check my last submission