Help with cses 1664

Revision en2, by BD_SM, 2019-08-16 15:42:36

https://cses.fi/problemset/task/1664 need help on how to solve this problem? I am storing for each i the closest time when a picture finishes if we start at i. This preprocess is O(n) but query worst case is o(n).help pls!

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English BD_SM 2019-08-16 15:42:36 168 (published)
en1 English BD_SM 2019-08-16 00:15:52 96 Initial revision (published)