Help needed to solve JOI 2013/2014 Problem — Historical

Revision en1, by Lance_HAOH, 2017-07-15 15:13:52

Hi. I am having problem trying to solve the last subtask for JNOI 2013/2914 — Historical Research. The english problem statement can be found here.

For those who can read Japanese, the editorial can be found here

The input and output data can be found here

My approach is as follows:

Perform square root decomposition on the queries by reordering them by their

Tags joi 2014, mos_algorithm, sliding window, two-pointers

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en3 English Lance_HAOH 2017-07-15 17:21:30 946 Tiny change: ' \right) $\n' -> ' \right) $. However, $ 1 \le Q,N \le 100000 $\n' (published)
en2 English Lance_HAOH 2017-07-15 16:50:43 1331 Tiny change: 'ht bound. Complexity ' -> 'ht bound. Time-complexity '
en1 English Lance_HAOH 2017-07-15 15:13:52 633 Initial revision (saved to drafts)