CSES Coin comb I TLE: why?

Revision en1, by bobbilyking, 2020-05-16 21:42:39

https://pastebin.com/zV3jsqy7

i did look at the CF editorial, and yeah my implementation (i don't think) is wrong. and someone else had the same TLE problem as me but he never said how he resolved it (if he ever did). Is this just a java thing? Editorial says that time complexity is n * target, which is 10^8 operations, so maybe I can make very very slight optimizations somewhere to get it under 1ms?

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English bobbilyking 2020-05-16 21:42:39 432 Initial revision (published)