c语言sscanf函数的用法是什么
210
2022-09-02
poj3207 Ikki's Story IV - Panda's Trick
Description
liympanda, one of Ikki’s friend, likes playing games with Ikki. Today after minesweeping with Ikki and winning so many times, he is tired of such easy games and wants to play another game with Ikki.
liympanda has a magic circle and he puts it on a plane, there are n points on its boundary in circular border: 0, 1, 2, …, n − 1. Evil panda claims that he is connecting m pairs of points. To connect two points, liympanda either places the link entirely inside the circle or entirely outside the circle. Now liympanda tells Ikki no two links touch inside/outside the circle, except on the boundary. He wants Ikki to figure out whether this is possible…
Despaired at the minesweeping game just played, Ikki is totally at a loss, so he decides to write a program to help him.
Input
The input contains exactly one test case.
In the test case there will be a line consisting of of two integers: n and m (n ≤ 1,000, m ≤ 500). The following m lines each contain two integers ai and bi, which denote the endpoints of the ith wire. Every point will have at most one link.
Output
Output a line, either “panda is telling the truth…” or “the evil panda is lying again”.
Sample Input
4 2 0 1 3 2 Sample Output
panda is telling the truth… Source
POJ Monthly–2007.03.04, Ikki 判断条件 a[i]< a[j]&&b[i]< b[j]&&b[i]>a[j]||a[j]< a[i]&&b[j]< b[i]&&b[j]>a[i] 满足这种情况两条线就必须一个在里面一个在外面 设2*i为里面2*i+1为外面 然后就互相连边即可 注意边数是m*m*2 然后tarjan缩点判断是否有里面和外面同时出现在环上
#include
版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。
发表评论
暂时没有评论,来抢沙发吧~