hsr's blog

By hsr, history, 5 years ago, In English,

I was solving http://codeforces.com/contest/560/problem/D

No matter how much I tried, I could not get pas testcase #91, it was always TLE for that one.

Then I tried switching the order in which the recursive function is called and then the programs passed within 31ms (program had 2s timelimit)

Here are the 2 solutions:

Accepted : http://codeforces.com/contest/560/submission/12186813

TLE : http://codeforces.com/contest/560/submission/12186933

Is there any reason why it failed or is it by pure co-incidence that the test cases broke my program.

Read more »

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