Skip to content

UVa 10054

Alex Wind edited this page Sep 16, 2013 · 1 revision

The Necklace

from Volume 2. Data Structures :: Graphs

Description

输入一堆两端有颜色的珠子。输出能否用一条绳子串起来。

Solution

求无相图的欧拉回路,先判断有没有欧拉回路,然后递归输出即可。输出的时候注意头尾相连,只要符合条件即可AC(不一定要像样例输出)。

Clone this wiki locally