[BOJ 12602] Polygraph (Large)

View as PDF

Submit solution

Points: 1
Time limit: 5.0s
Memory limit: 512M

Problem types
Allowed languages
Assembly, Awk, C, C++, Java, Pascal, Perl, Python, Sed, Text

On the distant isle of Googlia, there are two cities, Truthtown and Liarville. People from Truthtown always tell the truth and people from Liarville always lie. While exploring Googlia, you have run across a group of N inhabitants, and you want to figure out which city each one came from.

To make life simpler, you begin by numbering these people 1 through N. You then question each person, and record their M statements in the short-hand described below.

Short-hand Meaning
i T j Person #i says, "Person #j is from Truthtown."
i L j Person #i says, "Person #j is from Liarville."
i S j k Person #i says, "Persons #j and #k are from the same city."
i D j k Person #i says, "Persons #j and #k are from different cities."

Comments

There are no comments at the moment.