This problem came on TCS mockvita 2018.Here is a link to problem — https://www.programminggeek.in/2018/07/mockvita-2018-problem-heights-of.html?m=1

Any idea how to solve this?

# | User | Rating |
---|---|---|

1 | tourist | 3434 |

2 | OO0OOO00O0OOO0O0…O | 3280 |

3 | Syloviaely | 3274 |

4 | Um_nik | 3248 |

5 | Petr | 3233 |

6 | fateice | 3230 |

7 | mnbvmar | 3096 |

8 | anta | 3053 |

9 | FizzyDavid | 3050 |

10 | LHiC | 3047 |

# | User | Contrib. |
---|---|---|

1 | rng_58 | 162 |

2 | tourist | 160 |

3 | Petr | 153 |

4 | csacademy | 151 |

5 | Radewoosh | 149 |

6 | Swistakk | 147 |

7 | Vovuh | 145 |

7 | Um_nik | 145 |

9 | Nickolas | 142 |

10 | PikMike | 140 |

This problem came on TCS mockvita 2018.Here is a link to problem — https://www.programminggeek.in/2018/07/mockvita-2018-problem-heights-of.html?m=1

Any idea how to solve this?

↑

↓

Codeforces (c) Copyright 2010-2018 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Aug/15/2018 03:01:52 (d1).

Desktop version, switch to mobile version.

User lists

Name |
---|

Great approach. I thought one topological sort will work after adding all the edges. But your approach looks like to be correct.