mshiladityam's blog

By mshiladityam, history, 7 weeks ago, In English

Hi. I finally solved problem F from ABC 180 but my happiness was short-lived because it took $$$7s$$$ for my program to run on the worst case ($$$N=300$$$ $$$M=300$$$, $$$L=300$$$) in Custom Invocation.

Here is the link to my submission.

I have proven that the time complexity of my solution is $$$O(NMLlog(L))$$$, and also maintained a variable tick (see line $$$83$$$ and line $$$184$$$) which shows the number of loop operations and in the worst case, $$$tick=76279724$$$, which is not even $$$10^8$$$.

I have tried to optimise my code in every way possible, but I can't bring it below $$$7$$$. Is my code doomed to fail because of the costly mod, or am I missing something?

You don't need to solve the problem to help me because I have maintained the variable tick and it is clearly less than $$$10^8$$$.

Any help would be appreciated! My code is quite short and neat :P

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

»
7 weeks ago, # |
  Vote: I like it -22 Vote: I do not like it

YAYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY

LOLOLOL I optimised the hell out of this one!! Can you believe it: I brought it from 7 wholeass seconds to 1.9 seconds!!! Yes, and all of it through constant time optimisations! LOLOLOLOL