addEdge(1, 5);
addEdge(1, 3);
addEdge(1, 2);
addEdge(2, 5);
addEdge(2, 3);
addEdge(3, 5);
addEdge(4, 5);
addEdge(4, 3);
然後用dfs從1開始去走所有路徑(不能重複走同一條路)
參考程式碼解答:
https://66lemon66.blogspot.com/2021/03/zerojudge-c139-00291-house-of-santa.html