toTalmeSS's blog

By toTalmeSS, history, 8 years ago, In English

Hello... I got TLE on the following problem. I myself found out that it's taking an awful amount of time for inputs with eight or nine digits! How can I optimize my code and reduce the complexity? I tried to devise a formula, but couldn't go anywhere. I can still try if any of you could tell me how to approach...

Thanks in advance.

Problem link My code

Full text and comments »

  • Vote: I like it
  • -8
  • Vote: I do not like it

By toTalmeSS, history, 8 years ago, In English

Hello guys... Here's my code for the first problem of the Canada Cup. Unfortunately, I got TLE on test case 4. I was really excited after preparing the solution as I've never been able to solve a single problem within the contest time. Is there anyway to optimize my code? Or do I have to change the approach altogether? Thanks in advance and happy coding to all! Problem link My code

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it

By toTalmeSS, history, 8 years ago, In English

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.

Problem link My code

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it