Блог пользователя nima10khodaveisi

Автор nima10khodaveisi, история, 7 лет назад, По-английски

Hello CodeForces !

We have an array with n integers and Q query. each query has 4 integers L1 , R1 , L2 , R2 such that (1 <= L1 <= R1 < L2 <= R2 <= n) and for answer to query we should print the number of distinct numbers in [L1 , R1] U [L2 , R2] !

I want to answer each query online :)

limits :

1 <= n , Q <= 10 ^ 5

1 <= a[i] <= 3 * (10 ^ 5)

GoodLuck :))

PS a[i] <= 3 * (10 ^ 5) maybe it can help us :))))

PS2 dacin21 solved this problem with an interesting solution :) thanks all

Полный текст и комментарии »

  • Проголосовать: нравится
  • +17
  • Проголосовать: не нравится