WA in TC 1 💡 Vivek and Party Graphs

my code: https://ide.codingblocks.com/s/158803
problem: https://hack.codingblocks.com/app/contests/782/p/781

Did it using topological sort with dfs.