Sohsoh84's blog

By Sohsoh84, history, 5 months ago, In English

Hi :), I used exit(1) in one of my submissions and I've got "Runtime error" in a test case with "NO" answer and I think that it was the first test case witch the "exit(1)" line was called.

then I removed "exit(1)" from my code, and I didn't change anything(but adding some code for handling the "NO" answer without "exit(1)") and I've got "Accept".

I want to know if the runtime error was from the "exit(1)", can I use the "exit()" command in c++, if I can, is there ant special status code for exit or not...

and sorry for my bad English :)

problem: 1287D - Numbers on Tree

submission with Runtime error: 79037752

correct submission: 79038193

 
 
 
 
  • Vote: I like it
  • +3
  • Vote: I do not like it

»
5 months ago, # |
  Vote: I like it +33 Vote: I do not like it

You can use exit(0)

»
5 months ago, # |
  Vote: I like it +18 Vote: I do not like it

Your program's exit code was 1, which corresponds to the verdict Runtime Error (non-zero exit code). It works exactly as intended.

»
5 months ago, # |
  Vote: I like it +11 Vote: I do not like it

You should you exit(0); like what we add return 0; at end of main(). "Non-zero-value returning" give you RTE verdict is correct

»
27 hours ago, # |
  Vote: I like it -32 Vote: I do not like it

سهیل سلام لطفا میشه افتخار بدی تو یه کانتست که منو و دوستم طرح کردیم شرکت کنی رفیق فابریک بهرادم. امیررضا و بهراد هم تو کانتست هستن

»
27 hours ago, # |
  Vote: I like it -32 Vote: I do not like it

اینم لینکشhttps://quera.ir/overview/add_to_course/course/6425