TLE

Revision en1, by toTalmeSS, 2016-11-08 09:08:13

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

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English toTalmeSS 2016-11-08 09:08:13 455 Initial revision (published)