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

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

hello everyone ; I am trying to solve this problem

https://codeforces.com/problemset/problem/791/A

and my submission is

https://codeforces.com/problemset/submission/791/162926301

The code is running and producing correct output for sample test cases in my local ide but in codeforces, I am getting Runtime error for sample testcase!!

Is there anything I am missing?

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

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

Dude, Codeforces even tells you a reason. Your function does not return anything in one of the cases. You should add a return keyword in front of a function call.

  • »
    »
    22 месяца назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    But why does it get accepted in c++17??

    • »
      »
      »
      22 месяца назад, # ^ |
      Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

      I hate that we cannot pin forever some blog like "What the undefined behaviour is and how not to fool yourself with "but it was accepted in my local/another server compilator"