应该不会有人跟我一样写错吧。不要写成:
if(dep[Hid[x]] > dep[Hid[y]]) swap (x , y);
正确的:
if(dep[x] > dep[y]) swap (x , y);