z-if
In order to become z-moderator, a user has to satisfy a lot of requirements. Actually, mister little Z. made the list of the requirements such that it is impossible to satisfy all of them
Mister little Z gives you a questionnaire with N YES/NO questions. After he gets your answers, he looks at your answers, checking whether they satisfy the M rules he has come up with.
For example, if the questions are:
Q1: Are you tall
Q2: Do you like PC more than MAC
Q3: Do you like Windows more than Unix
Little Z's list of rules can look like:
if Q1 then Q2
if Q2 then not Q3
if not Q2 then Q1
This can be satisfied if you choose the following answers:
Q1 - YES
Q2 - YES
Q3 - NO
However, if Z's list of rules was the following:
if Q1 then Q2
if Q2 then Q3
if Q3 then not Q1
if not Q1 then not Q2
if not Q2 then Q1
Then it is impossible to satisfy the requirements!
The question for you is: What is the minimal number of questions that Z should delete from the list (and therefore all the rules that contain that question) so that the remaining set of rules can be satisfied?
6
if green then not fat
if man then not green
if fat then not man
if not green then fat
if not man then green
if not fat then manOutput:
15
if green then not green
if not green then green
if man then green
if man then not man
if not man then manOutput:
2Submit solution
Coming laterThe grading service will be connected in a later migration step. You can inspect the task and your previous results now.