P3496 [POI 2010] GIL-Guilds

题目描述

King Byteasar faces a serious matter. Two competing trade organisations, The Tailors Guild and The Sewers Guild asked, at the same time, for permissions to open their offices in each town of the kingdom. There are ![](http://main.edu.pl/images/OI17/gil-en-tex.1.png) towns in Byteotia. Some of them are connected with bidirectional roads. Each of the guilds postulate that every town should: have an office of the guild, or be directly connected to another town that does. The king, however, suspects foul play. He fears that if there is just a single town holding the offices of both guilds, it could lead to a clothing cartel. For this reason he asks your help. 给一张无向图,要求你用黑白灰给点染色,且满足对于任意一个黑点,至少有一个白点和他相邻;对于任意一个白点,至少有一个黑点与他相邻,对于任意一个灰点,至少同时有一个黑点和白点和灰点与他相邻,问能否成功

输入格式

输出格式

说明/提示

题目spj贡献者@mengbierr