20180717 D. Take Your Seat

本文介绍了2018年ACM-ICPC中国大学生程序设计竞赛中涉及的一个概率问题:乘客随机坐飞机座位的情况。分析了两种不同情况下的概率,第一种是按顺序登机,第二种是随机登机。对于最后一名乘客,计算他们坐到正确座位的概率,并给出了相应的解答公式。
摘要由CSDN通过智能技术生成

The 2018 ACM-ICPC Chinese Collegiate Programming Contest

Duha decided to have a trip to Singapore by plane.

The airplane had nn seats numbered from 11 to nn, and nn passengers including Duha which were also counted from 11 to nn.The passenger with number ii held the ticket corresponding to the seat with number ii, and Duha was the number 11 passenger.

All passengers got on the plane in the order of their numbers from 11 to nn.However, before they got on the plane Duha lost his ticket (and Duha was the only passenger who lost the ticket), so he could not take his seat correctly.He decided to take a seat randomly.And after that, while a passenger got on the plane and found that his/her seat has been occupied, he/she selected an empty seat randomly as well.A passenger except Duha selected the seat displayed in his/her ticket if it had not been occupied by someone else.

The first problem you are asked to calculate in this problem is the probability of t

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值