TLE on Equivalent Strings

Правка en1, от hsr, 2015-07-22 20:54:07

I was solving http://codeforces.net/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.net/contest/560/submission/12186813

TLE : http://codeforces.net/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.

Теги 560d, recursion

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский hsr 2015-07-22 20:54:07 756 Initial revision (published)