1 人解决,2 人已尝试。
1 份提交通过,共有 3 份提交。
9.7 EMB 奖励。
单点时限: 5.0 sec
内存限制: 256 MB
The group of travelers has an opportunity to visit several cities. Each traveler states two wishes on what city he/she does want or does not want to visit. One wish expresses will to visit or not to visit exactly one city. It is allowed that both wishes of the one traveler are the same or that they are opposite – i.e. I want to visit city A, and I do not want to visit city A.
Your task is to write a program that:
If there are several possible solutions, your program should output anyone of them.
The first line of the input contains two positive integers
Your program should write one nonnegative integer
In case it is not possible to form such a list of cities, your program should write in the first and only line the word NO
.
3 4 1 -2 2 4 3 1
4 1 2 3 4
1 人解决,2 人已尝试。
1 份提交通过,共有 3 份提交。
9.7 EMB 奖励。