Stuck with TLE for a problem

Revision en2, by TheDark_Knight, 2020-04-14 21:05:09

Hey, I have been stuck at this problem for quite long 327E - Axis Walking. According to the editorial the author specified an approach involving "meet in the middle", but my implementation caused a TLE 76646016. Then he had mentioned that a bitmask DP approach of O(n*(2^n)) somehow unintentionally manages to pass the test cases & referenced to a particular submission 4017915. I had gone through the code but once again when implemented it caused a TLE. To figure out the reason behind this I tried to step by step make my code similar to the AC submission ( 4017915 ) mentioned in the editorial but again failed at the end with my submission as: 76648464.

Any kind of help would be appreciated.

Edit: This issue has been solved by converting all long long to int everywhere.

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English TheDark_Knight 2020-04-14 21:05:09 83
en1 English TheDark_Knight 2020-04-14 04:52:54 775 Initial revision (published)