005柯南破案之凶手是谁

这篇博客探讨了一道逻辑推理题,涉及柯南破案的情境。通过初始化嫌疑人位置,根据死者死亡时间排除不在场可能性,并利用动态数组追踪嫌疑人在死者死亡前的行动,最终找出可能的凶手。
摘要由CSDN通过智能技术生成

题目来源:

Problem Statement
Dr. Black was just killed somewhere in his mansion. You are investigating the murder.

There are six suspects: "White", "Green", "Peacock", "Plum", "Scarlett", and "Mustard".

There are eight rooms: "Hall", "Kitchen", "Ballroom", "Conservatory", "Cellar", "Library", "Lounge", and "Study".

Initially (at time 0) all suspects were in the Hall.

Dr. Black was staying in the room murderRoom for the whole time, and that is also where he was killed. An autopsy of his body has shown that the time of the murder was murderTime.

You have collected a chronologically ordered sequence of events. For each valid index i, there is an event of the following form: "At time eventTime[i], the suspect eventPerson[i] moved to the room eventRoom[i]."

Find the murderer! That is, if there is a single suspect who was in the murder
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值