Please subscribe to the official Codeforces channel in Telegram via the link https://t.me/codeforces_official. ×

Jimmy_Admin's blog

By Jimmy_Admin, history, 6 hours ago, In English

Please help me solve this problem. I think can use dp bitmask to solve it but I haven't come up with a solution yet. Thanks!

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

»
5 hours ago, # |
Rev. 4   Vote: I like it 0 Vote: I do not like it
  • Maintain a map of value and index that keeps track of in which lists xi are present.
  • To get the lists with which a particular list pair with, merge the sets of index for A[I],B[I],C[I],D[I],E[I].
  • (number of list — the size merge set) will be the answer for a paricular list.
  • Do this for all the lists and add the answer.
  • »
    »
    5 hours ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    i didn't get it can you explain the merge set part how we will do it