ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1036. Lucky Tickets

Crash on 3 test
Posted by Koshmarik 26 Feb 2006 02:07
  Have anybody crash on 3 test?
It's interesting, that my friend decided this problem and on tests with n>50 we have the same answer.
Re: Crash on 3 test
Posted by Vitaliy_Ivashchenko 6 Feb 2008 23:09
I had. You must add in your programm something like this:

 if(sum/9>2*n){
  printf("0");
  return 0;
 }
Re: Crash on 3 test
Posted by phizaz 8 Apr 2011 21:30
thanks. I just found my forgotten! my program cannot print 0 'zero' ( - -")
Re: Crash on 3 test
Posted by Anurag Ohri 29 Oct 2013 11:56
Why is this condition required? The recursive formula takes care of this.. Without this condition my code gets WA3.. And when I add it, it gets AC.. Could you plz give a test case where this condition is really required, where the DP formula fails..??
Re: Crash on 3 test
Posted by lqt121720 22 Jun 2022 08:43
I don't think it's DP formula's fault
Perhaps when you are deleting leading zero, you haven't judge if the point is >= 0