题目给出图,要求判断不能一遍走完所有边,也就是无向图,题目分类是分欧拉回路,但其实只要判断度数就行了. 一开始以为只要判断度数就可以了,交了一发WA了.听别人说要先判断是否是联通图,于是用并查集并一起,然后判断是否有多个根. 用dfs的话就是深搜时标记下,最后看看有没有全部标记.我没用dfs做. 代码: #include <cstdio> const int maxn = 201; int f[maxn]; int d[maxn]; int find(int x) { if (x != f[x…
A. Broken Clock time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output You are given a broken clock. You know, that it is supposed to show time in 12- or 24-hours HH:MM format. In 12-hours format…