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

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

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.

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

»
7 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Auto comment: topic has been updated by Tuhin_RU (previous revision, new revision, compare).

»
7 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

farmersrice please give me any clue.