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

Автор hkbishwa, история, 7 лет назад, По-английски

Hello, codeforces community!

I am recently working on a project of building a Online Judge using Java and my minimum target was at least to make sure that it can detect the four most popular verdicts in Competitive Programming world. I somehow managed to implement AC, WA, TLE. But I am at a loss how to handle Runtime Error. For most of the cases, my program takes RE as TLE. I am just curious to know how can one determine Runtime Error effectively. I would love to have some idea about it and which can be a better a platform than CF community!

Thanks to all in advance.

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

»
7 лет назад, # |
  Проголосовать: нравится +1 Проголосовать: не нравится

Check the return value of the process. If it is non-zero, it is RTE.

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

    Thank you. I tried it but for a c code with a simple 1/0 statement it took 40 sec to terminate and return a non-zero value :(

»
7 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

When a runtime error occurs the output will be null. So check if the output is null or not. that's it.

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

    I'm afraid I could not get the meaning of "output" in your comment. what did you mean by output? Can you please elaborate ?

    If you mean by "output" the output of the program submitted by the client against judge data, then what about the case when the code will get a TLE? Because in this case the output will also be a null, I think. Am I right?

    Please clarify :D

»
7 лет назад, # |
  Проголосовать: нравится +1 Проголосовать: не нравится

If you are in Linux and coding in python, you can use this script: https://ideone.com/jHoSRD
It can handle all the things. (observe from line 42).

»
7 лет назад, # |
  Проголосовать: нравится +1 Проголосовать: не нравится

I have no much experience in this but you can do it by trick First check for TLE then terminate the program and check for the output because most problem doesn't exceed 15 second