Getting time limit exceed
@Jun18APP0112
I have fixed your code.
You should not have created an adjacency matrix. because that is O(V*V) which is very large hence TLE.
but sir i am getting tle for small input given in sample test case
see the value of v.size() and E.