HBC209383ClamandFish题解

为你而来永不停止 算法基础篇 43 0
想要检验自己的编程水平?来试试全网最全C++题库,让您在挑战中不断进步。
There is a fishing game as following: The game contains nnn stages, numbered from 111 to nnn. There are four types of stages (numbered from 000 to 333): type 000: Ther

There is a fishing game as following: The game contains nnn stages, numbered from 111 to nnn. There are four types of stages (numbered from 000 to 333): type 000: There are no fish and no clam in this stage. type 111: There are no fish and one clam in this stage. type 222: There are one fish and no clam in this stage. type 333: There are one fish and one clam in this stage. In each stage, you can do exactly one of the following four actions. If there is a clam in the stage, you can use this clam to make one pack of fish bait. And the number of packs of fish bait you have is increased by one.  You can use this pack of fish bait to catch fish after this stage. If there is one fish in the stage, you can catch this fish without any fish bait. After this stage, the number of packs of fish bait you have is not changed. If you have at least one pack of fish bait. You can always catch one fish by using exactly one pack of fish bait even if there are no fish in this stage. After this stage, the number of packs of fish bait you have is decreased by one. You can do nothing. Now, you are given nnn and the type of each stage. Please calculate the largest number of fish you can get in the fishing game.

HBC209383ClamandFish题解
-第1张图片-东莞河马信息技术
(图片来源网络,侵删)
成为编程大师,不再是梦想!全网最全C++题库,助您开启编程新篇章。

标签: HBC209383ClamandFish题解