NOT a SAT problem
Time limit2sMemory limit1024 MB
Find a truth assignment that makes the given CNF false, or report NO if every clause contains both a variable and its negation.
- Level
Easy2 of 10
- Topics
- Implementation, String
- Solved
- No attempts yet
Problem
A SAT problem asks whether you can assign true or false to the logical variables so that a given CNF evaluates to true.
- A CNF is one or more clauses joined by (logical AND).
- A clause is one or more variables, or negated variables, joined by (logical OR).
For example, and are clauses. Joining them gives the CNF .
This problem is not a SAT problem. Instead of making the CNF true, you must make the CNF false.
Input
The first line contains the number of variables and the number of clauses (, ).
Each of the next lines describes one clause. The first integer is the number of literals in the clause (), followed by integers . A positive means appears in the clause, and a negative means appears in the clause ().
The sum of all is at most .
Output
On the first line, print YES if you can make the CNF false, and NO otherwise.
If you can make the CNF false, print on the second line the values of separated by spaces, where means true and means false. If several assignments work, print any one of them.