分析: 基础的欧拉路算法,变化在于要求每条边正向和反向各走一遍. 链式前向星构图,只要标记走过的单向边,边找边输出即可. code #include <iostream> #include <cstdio> using namespace std; struct node { int v, ne; } edge[100009]; int head[10009], vis[100009], cnt = 1; int n, m, x, y; void addedge (int u, i…
题目链接: http://poj.org/problem? id=1780 Code Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 2037 Accepted: 751 Description KEY Inc., the leading company in security hardware, has developed a new kind of safe. To unlock it, you don't nee…
Catenyms Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 11648 Accepted: 3036 Description A catenym is a pair of words separated by a period such that the last letter of the first word is the same as the last letter of the second. For…
Sightseeing tour Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 6986 Accepted: 2901 Description The city executive board in Lund wants to construct a sightseeing tour by bus in Lund, so that tourists can see every corner of the beauti…
题目链接: http://poj.org/problem?id=2513 http://bailian.openjudge.cn/practice/2513?lang=en_US Time Limit: 5000MS Memory Limit: 128000K Description You are given a bunch of wooden sticks. Each endpoint of each stick is colored with some color. Is it possi…