Пожалуйста, подпишитесь на официальный канал Codeforces в Telegram по ссылке https://t.me/codeforces_official. ×

How can be solved this Data_Structure problem.

Правка en8, от Tuhin_RU, 2018-03-10 08:37:47

Suppose, there's n persons A1,A2,....,An. Person Ai have a set of p_i_ numbers, Xi.1,Xi.2,....,Xi.pi. You have Q quaries. Each quary is two types.

1 in t S1 S2 .... St.

Set p_in_ with t and Xi with S.

2 l r m S1 S2 ... Sm.

Calculate the number of people Al...Ar, who has at least one number Si in his set p_i_

1<=n,Q<=100000

1<=p_i_,t,m<=20

1<=Si,each element of Xi<=1000000

How can be it solved?

N.B.: Its a problem of an onsite contest occured 2 weeks ago.

Теги #data structure

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en8 Английский Tuhin_RU 2018-03-10 08:37:47 5
en7 Английский Tuhin_RU 2018-03-09 20:45:54 6
en6 Английский Tuhin_RU 2018-03-09 20:40:03 47 Tiny change: 'te contest.' -> 'te contest occured 2 weeks ago.'
en5 Английский Tuhin_RU 2018-03-09 20:37:30 7
en4 Английский Tuhin_RU 2018-03-09 20:36:55 10
en3 Английский Tuhin_RU 2018-03-09 20:36:09 24
en2 Английский Tuhin_RU 2018-03-09 20:34:54 4
en1 Английский Tuhin_RU 2018-03-09 20:33:59 476 Initial revision (published)