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

Автор whitecow, 3 года назад, По-английски

Let's say I am solving some question 'Q' with time limit 1 second and space limit 256 MB. Upon submitting, I get MLE for 4 out of 5 test cases and TLE on the last TC. Also, the TCs which are giving MLE are showing a runtime of <=0.5 seconds (let's call this run time as 'x').

Based on the above scenario, which of the following statement is correct?

1) The run time 'x' is the total run time of that TC if we ignore the MLE?

or

2) The code got terminated at xth moment of time (for that TC) as soon as it encountered MLE?

Which of the above option is correct, or is there any other explanation to this?

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

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

I really think that second case is what actually happens, because if you have infinite recursion in your programm, your solution can got MLE, and time will be like 264 ms with TL 3s. In my opinion, that means that program stopped right after it had encountered MLE.

After all, second case is more logical. Why would codeforces leave additional load to servers?