_BEAST_00_'s blog

By _BEAST_00_, history, 21 month(s) ago, In English

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?

  • Vote: I like it
  • -1
  • Vote: I do not like it

| Write comment?
»
21 month(s) ago, # |
  Vote: I like it +13 Vote: I do not like it

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.

  • »
    »
    21 month(s) ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

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

    • »
      »
      »
      21 month(s) ago, # ^ |
      Rev. 2   Vote: I like it 0 Vote: I do not like it

      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"