Help with last Div3 Problem H

Revision en1, by Xbalanque, 2024-09-03 02:13:14

2008H - Sakurako's Test

Editorial says Let's fix one x and try to solve this task for it.

okay makes our time complexity q*(something), moving on...

How to find number of i that ai mod x ≤ m for some m

We can use binary search of some sort, making our complexity

q*log(x)*checkerForM, how in the world is this complexity not TLE

Can anyone explain it to me.

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English Xbalanque 2024-09-03 02:13:14 417 Initial revision (published)