CF94B.Friends
普及-
通过率:0%
时间限制:1.00s
内存限制:256MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
One day Igor K. stopped programming and took up math. One late autumn evening he was sitting at a table reading a book and thinking about something.
The following statement caught his attention: "Among any six people there are either three pairwise acquainted people or three pairwise unacquainted people"
Igor just couldn't get why the required minimum is 6 people. "Well, that's the same for five people, too!" — he kept on repeating in his mind. — "Let's take, say, Max, Ilya, Vova — here, they all know each other! And now let's add Dima and Oleg to Vova — none of them is acquainted with each other! Now, that math is just rubbish!"
Igor K. took 5 friends of his and wrote down who of them is friends with whom. Now he wants to check whether it is true for the five people that among them there are either three pairwise acquainted or three pairwise not acquainted people.
一天,Igor K. 放下了编程,转而钻研数学。一个深秋的夜晚,他坐在桌旁读书,同时思考着一些问题。
下面这句话引起了他的注意:“在任意六个人中,总存在三人彼此都相互认识,或三人彼此都不认识。”
Igor 实在想不通为什么所需的最少人数是 6 人。“哎,五个人不也一样吗!”——他在心里反复念叨,“比如说,取 Max、Ilya、Vova 这三人——他们彼此都认识!然后再把 Dima 和 Oleg 加进来,且都只与 Vova 相识——那么 Dima 和 Oleg 彼此并不相识!这数学纯粹是胡扯!”
Igor K. 找来了他的 5 位朋友,并记录下了他们之间谁与谁是朋友。现在,他想验证:对于这五个人而言,是否确实存在三人彼此都相互认识,或者三人彼此都不认识。
输入格式
The first line contains an integer m (0 ≤ m ≤ 10), which is the number of relations of acquaintances among the five friends of Igor's.
Each of the following m lines contains two integers a__i and b__i (1 ≤ a__i, b__i ≤ 5;a__i ≠ b__i), where (a__i, b__i) is a pair of acquainted people. It is guaranteed that each pair of the acquaintances is described exactly once. The acquaintance relation is symmetrical, i.e. if x is acquainted with y, then y is also acquainted with x.
第一行包含一个整数 m(0≤m≤10),表示伊戈尔的五位朋友之间相识关系的数量。
接下来的 m 行,每行包含两个整数 ai 和 bi(1≤ai,bi≤5;ai=bi),其中 (ai,bi) 表示一对相互认识的人。保证每对相识关系仅被描述一次。相识关系是对称的,即若 x 认识 y,则 y 也认识 x。
输出格式
Print "FAIL", if among those five people there are no either three pairwise acquainted or three pairwise unacquainted people. Otherwise print "WIN".
如果这五个人中既不存在三对两两相识的人,也不存在三对两两互不相识的人,则输出 "FAIL";否则输出 "WIN"。
输入输出样例
输入#1
4 1 3 2 3 1 4 5 3
输出#1
WIN
输入#2
5 1 2 2 3 3 4 4 5 5 1
输出#2
FAIL
输入解题思路,AI测评打分。不知道怎么写?