@tpb @jonnin
Can someone explain me how to approach this problem https://www.codechef.com/LOCJUL18/problems/COLCHEF
I solved the subpart using maps but getting TLE for the last subtask I think
there should be an easier solution than this
Can someone explain how to do this in c++
connect
1,2
3,4
5,6
then there is path between
1->2
3->4
5->6
now connect 2 and 3
so the whole path gets connects
but 5->6 remains disconnected and then we can check if 1 is connected to 4 or not
1->2->3->4
5->6
Last edited on