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

Автор saketkumarsingh, история, 15 месяцев назад, По-английски

Can someone tell the approach for this interesting question: Question

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

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

Correct me if I'm wrong. My first thought for this problem was dp. dp(i) -> maximum posters till i th element in some defined order that works (maybe sort using x and y?) but soon became doubtful if such an order even exists. For all 2 pairs we can find if the 2 posters are overlapping or not. If we create a graph and add edge b/w 2 nodes (posters) if they are NOT overlapping, then we need to find the largest connected component size which is completely connected (edge b/w every pair #E=n(n-1)/2)

  • »
    »
    15 месяцев назад, # ^ |
      Проголосовать: нравится +10 Проголосовать: не нравится

    this is a matching problem , it kinda makes sense that no greedy/dp algorithm would work even if you didnt knew the tags tho.Most of the time if it is a problem about selecting things that are limiting each other by someway and no greedy seems to work, it is a matching problem.You can learn bipartite matching algorithm and then try the problem again

»
15 месяцев назад, # |
Rev. 5   Проголосовать: нравится 0 Проголосовать: не нравится

I keep false solving