Codeforces Round 1133 (Div. 1, Div. 2) is coming soon! Register here. ×

tmp

Revision en1, by MIRAJ12, 2026-07-19 07:48:26

Prerequisites

The main idea comes from the sliding window technique. Suppose you have q queries where every query has a fixed length (r - l) = k. You can answer each query by combining information from two blocks of size k-1 use the suffix v left block and the prefix right block. Then, you can compute the ans using those two values.

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en8 English MIRAJ12 2026-07-19 10:46:28 26
en7 English MIRAJ12 2026-07-19 09:30:26 56
en6 English MIRAJ12 2026-07-19 09:28:34 4 Tiny change: 'r of 2 to `x` or the' -> 'r of 2 to <=`x` or the' (published)
en5 English MIRAJ12 2026-07-19 09:26:16 3195 Tiny change: 'ructure:** For any qu' -> 'ructure:**\n\nFor any qu'
en4 English MIRAJ12 2026-07-19 09:03:54 551 Tiny change: 'he same.\n\n' -> 'he same.\n![ ](https://codeforces.me/ba2581/Cp 3.jpeg)\n\n\n'
en3 English MIRAJ12 2026-07-19 08:37:51 840 Tiny change: 'e problem:[CSES Slid' -> 'e problem: [CSES Slid'
en2 English MIRAJ12 2026-07-19 08:11:39 352 Tiny change: 'ueries is:\n\n**l = 6, r = 9**\n\nSo, we c' -> 'ueries is:**l = 6, r = 9**\nSo, we c'
en1 English MIRAJ12 2026-07-19 07:48:26 354 Initial revision (saved to drafts)