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

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

Автор Jimmy_Admin, история, 5 часов назад, По-английски

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!

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

»
5 часов назад, # |
Rev. 4   Проголосовать: нравится 0 Проголосовать: не нравится
  • 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 часов назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

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