Блог пользователя Md_Abu_Taleb

Автор Md_Abu_Taleb, история, 22 месяца назад, По-английски

problem link

HERE this solution accepted in c++17 but https://codeforces.me/contest/1971/submission/290780147 runtime error in c++20/23 i found similar problem same code WA in test 1 int 17 and WA in 2nd test in c++20 !!

  • Проголосовать: нравится
  • +1
  • Проголосовать: не нравится

»
22 месяца назад, скрыть # |
 
Проголосовать: нравится +3 Проголосовать: не нравится

Well, the compiler is right. Undefined behavior means that the code can have any result. Btw, if I use custom invocation of your accepted solution under c++17 on this test

1
10 1 11
10
1
9
8
1
10
7
0
2
6
5
4
3

then I will get: https://imgur.com/a/haQfRI3, which is obliviously WA.