HBC15701B. Salty Fish Go!题解

冷默言语 算法基础篇 33 0
题库丰富多样,涵盖各个领域,全网最全C++题库,让您在练习中不断成长!
A few days ago, WRD was playing a small game called Salty Fish Go. We can simplify the rules of the game as follows. The road can be abstracted into a one-dimensional axis, and the length of the road is L. There are two magic doors at the ends of the road, which can instantly transfer WRD from position L to position 0, or from location 0 to location L, without spending time. WRD can select the initial position, the initial direction of movement, and the initial speed . There are some amazing gas stations on the way, whose location is random. At the gas station WRD can change speed to one of the speed set, without spending time. (Do not change direction!) There are some jewels on the road, whose location is random. WRD needs to take away all the jewels to win the game. How long does it take WRD to win the game?It’s an easy game. But considering that WRD has become a salty fish without brain, all his operations are completely random. Can you calculate the expected time for him to win the game?

A few days ago, WRD was playing a small game called Salty Fish Go. We can simplify the rules of the game as follows. The road can be abstracted into a one-dimensional axis, and the length of the road is L. There are two magic doors at the ends of the road, which can instantly transfer WRD from position L to position 0, or from location 0 to location L, without spending time. WRD can select the initial position, the initial direction of movement, and the initial speed (from the speed set). There are some amazing gas stations on the way, whose location is random. At the gas station WRD can change speed to one of the speed set, without spending time. (Do not change direction!) There are some jewels on the road, whose location is random. WRD needs to take away all the jewels to win the game. How long does it take WRD to win the game? It’s an easy game. But considering that WRD has become a salty fish without brain, all his operations are completely random. Can you calculate the expected time for him to win the game?

HBC15701B. Salty Fish Go!题解
-第1张图片-东莞河马信息技术
(图片来源网络,侵删)
不断挑战自我,才能突破极限!全网最全C++题库,让您在编程道路上越走越远。

标签: HBC15701B. Salty Fish Go!题解