Ants Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 10722 Accepted: 4752 Description An army of ants walk on a horizontal pole of length l cm, each with a constant speed of 1 cm/s. When a walking ant reaches an end of the pole, it imm…
B - Bing it Time Limit:3000MS Memory Limit:0KB 64bit IO Format:%lld & %llu Submit Status Practice UVALive 4764 Description I guess most of you played cards on the trip to Harbin, but I'm sure you have never played the following card game. Thi…
题目给出图,要求判断不能一遍走完所有边,也就是无向图,题目分类是分欧拉回路,但其实只要判断度数就行了. 一开始以为只要判断度数就可以了,交了一发WA了.听别人说要先判断是否是联通图,于是用并查集并一起,然后判断是否有多个根. 用dfs的话就是深搜时标记下,最后看看有没有全部标记.我没用dfs做. 代码: #include <cstdio> const int maxn = 201; int f[maxn]; int d[maxn]; int find(int x) { if (x != f[x…