Number of distinct integers in two subarray

Правка en2, от nima10khodaveisi, 2017-09-13 17:53:25

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 :))))

Теги problem, segment tree

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en3 Английский nima10khodaveisi 2017-09-13 21:15:39 101 Tiny change: 'us :))))\n**PS2** ' -> 'us :))))\n\n**PS2** '
en2 Английский nima10khodaveisi 2017-09-13 17:53:25 58 Tiny change: '))\n\n**PS : ** a[i] <=' -> '))\n\n**PS** a[i] <='
en1 Английский nima10khodaveisi 2017-09-13 10:11:04 419 Initial revision (published)