adipro1167's blog

By adipro1167, history, 4 years ago, In English

Hello Codeforces! In yesterday's contest Codeforces Round 651 (Div. 2), on submitting the solution to B problem 1370B - Сжатие массива и НОД, 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!

  • Vote: I like it
  • 0
  • Vote: I do not like it

| Write comment?
»
4 years ago, # |
Rev. 3   Vote: I like it 0 Vote: I do not like it

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