alaudo's blog

By alaudo, 10 years ago, translation, In English

Hi

I have deliberately read the rules and completely understand the reasoning of site's administration behind the decision not to disclose test sets. And I agree to put up with this decision for this place's sake, for this is the only place where I can peek at the solutions submitted by the leaders and compare them to my owns.

But what should I do if -- in my opinion -- my code seems to be correct but it just fails on a certain lengthy test?

If the code just returns a wrong answer, the system provides you with both expected and actual answers and one can use this information for further debugging.

But how can I tackle execution errors in my code? I have seemingly working code that dies on one of lengthy tests: 6810527. And I am completely perplexed what to do now: does it fail while reading the data input, during computation or output?

I fully agree with people agrumenting that it is my fault and that there are multiple submissions where this doesn't happen. But I want to understand why my code is failing!

Is there any possibility to return any kind of debugging information on execution failure? I can, if required, to output some information to stderr so I can see it later along with test results (or only 200 characters to avoid passing the input data through into stderr).

Thanks in advance,

Alexander.

PS: As I was prompted in the comments, I can basically output any textual informaiton into stdout and look at it in the results of my code execution. So, just wrapping my complete code into a single global try/catch already did the trick and I found out that it was an overflow execption in LINQ Sum() extension method...

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