zeus_iitg's blog

By zeus_iitg, history, 4 years ago, In English

Critical Cities


Link to problem: Critical Cities

Kindly share your approach to solve this problem.

Any help is highly appreciated.

  • Vote: I like it
  • +13
  • Vote: I do not like it

»
4 years ago, # |
  Vote: I like it +20 Vote: I do not like it

That problem is a direct application of Dominator Tree.

  • »
    »
    4 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Thanx for answering. I did the same but getting a WA verdict. Mostly because i still don't understand what has to be printed as the result. Could anybody make the problem statement more clear.

    Thanx in advance

    • »
      »
      »
      4 years ago, # ^ |
        Vote: I like it +5 Vote: I do not like it

      If you did the Dominator Tree sol, you are just supposed to print all ancestors of n on the tree. Did you forget to sort you answer? :p

»
4 years ago, # |
Rev. 2   Vote: I like it +8 Vote: I do not like it

From which website the problem is taken? I've never heard.

»
4 years ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

My bad, the graph is directed :/

  • »
    »
    4 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Do you have code for this? How are you dealing with the fact graph is directed? I don't think this is correct unless I am greatly misunderstanding...