Hello guys... I need help on this problem. I've tried my code against various outputs, but still the judge shows "Wrong Answer". Where's the problem? At first I thought maybe the numbers(suppose n) which can be expressed as m!(m is another number smaller than n), but not as sum of factorials, are giving me WA; but I tried that way too and got WA. It'd be a great help to me if anyone could point out what should be done. Thanks in advance.








Increase size of array dp
Yes, either that or search factorials from 19! down, because 20! > 1018, so it's not needed.
Thanks a lot to both of you. Got accepted. It was a silly mistake... should've figured it out by myself... Anyway, thanks again...