Rating changes for last rounds are temporarily rolled back. They will be returned soon. ×

Mujh_lui's blog

By Mujh_lui, history, 6 years ago, In English

How to find the number of contiguous subsequences in a given range ?

Example :

4 (N)

1 2 3 4 (array[i])

2 4 (Query)

Need to find the number of contiguous subsequences from 2 to 4 whose value is a perfect square.

Explanation :

{ 2 & 3 & 4 } = 0 (Perfect Square)

{ 3 & 4 } = 0 (Perfect Square )

{4 } = 4 (Perfect Square )

Range:

N <=10^5 Q<=5*10^5 (Query)

Full text and comments »

  • Vote: I like it
  • -29
  • Vote: I do not like it