python中去掉第n个数据_从Python2.7列表中删除第n个元素

在一个生死攸关的游戏里,作为一艘帆船的船长,在被海盗俘虏后必须选择一个数字N来决定船员们走跳板的顺序。游戏规则为:从船长开始数,每数到N的人将被迫走跳板,直到剩下最后一人,该人将获得自由。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

You are the captain of a sailing vessel and you and your crew have been captured by pirates. The pirate captain has all of you standing in a circle on the deck of his ship trying to decide in which order you should walk the plank. Eventually he decides on the following method:

(a) The pirate captain asks you to pick a number N.

(b) The first person to walk the plank will be the Nth person

(starting from you).

(c) The captain will then continue around the circle forcing every Nth

person to walk the plank.

(d) Once there is only one person left, that person will be given

freedom.

For example: The crew consists of: Andrew, Brenda, Craig, Deidre,

Edward, Felicity, Greg and Harriet. Andrew selects N=2. The crew will

walk the plank in the order: Brenda, Deidre, Felicity, Harriet, Craig,

Greg, Edward. Andrew will be given freedom.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值