Werewolf(狼人杀) is a game in which the players are partitioned into two parties: the werewolves and the human beings. Suppose that in a game,
player #1 said: “Player #2 is a werewolf.”;
player #2 said: “Player #3 is a human.”;
player #3 said: “Player #4 is a werewolf.”;
player #4 said: “Player #5 is a human.”; and
player #5 said: “Player #4 is a human.”.
Given that there were 2 werewolves among them, at least one but not all the werewolves were lying, and there were exactly 2 liers. Can you point out the werewolves?Now you are asked to solve a harder version of this problem: given that there were N players, with 2 werewolves among them, at least one but not all the werewolves were lying, and there were exactly 2 liers. You are supposed to point out the werewolves.
Input Specification:
Each input file contains
【PAT甲级】1148 Werewolf - Simple Version (20 分)(枚举,思维)
最新推荐文章于 2023-02-26 22:13:29 发布
解决一个狼人杀逻辑问题,给定玩家陈述,找出2个狼人。题目描述了游戏规则和玩家发言,需要找到至少一个狼人在说谎且共有2个说谎者。通过枚举狼人位置并分析说谎情况来确定解决方案。
摘要由CSDN通过智能技术生成