Truth and Lie
CodeChefOpen on judge ↗
There are two cities namely Truthtown and Liarville on the distant isle of Googlia. People living in Truthtown always tell the truth and people living in Liarville always lie. While exploring the isle you can 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 p
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start