HBC207629Movingstones题解

人生如戏 算法基础篇 21 0
挑战自我,勇攀编程高峰!全网最全C++题库,助您成为编程达人。
One day, GK was getting very bored with palying stones. So he made a rule for himself: There are n piles of stones in total, at least 0 stones in each pile. You can select a pile of stones each time you move, and then take out one stone from each other and put them into the selected pile. The number of stones in any pile at any time cannot be less than 0.That is to say, before you select a pile of stones to add to it, if there have a pile of 0 stones in other piles, you will not be able to select this pile of stones. GK wants to know if he can make every pile of stones equal by lots of operation as many times as he want. GK never does anything uncertain, so after a long meditation, he decides to ask for your help.

One day, GK was getting very bored with palying stones. So he made a rule for himself: There are n piles of stones in total, at least 0 stones in each pile. You can select a pile of stones each time you move, and then take out one stone from each other (n-1 in total) and put them into the selected pile. The number of stones in any pile at any time cannot be less than 0.That is to say, before you select a pile of stones to add to it, if there have a pile of 0 stones in other piles, you will not be able to select this pile of stones.(For example,there are 3 piles of stones,1 4 1,If you choose the second pile, it will become 0 6 0,and you won't be able to do anything next ) GK wants to know if he can make every pile of stones equal by lots of operation as many times as he want. GK never does anything uncertain, so after a long meditation, he decides to ask for your help.

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

标签: HBC207629Movingstones题解