jackpot 翻译一下一道ACM题,希望是计算机专业的来翻译一下.
发布网友
发布时间:2022-04-25 00:26
我来回答
共2个回答
热心网友
时间:2023-10-17 12:14
Description
描述
Bill has found the perfect way to make money playing the slot machines. After months of careful research, he has finally figured out the mechanics behind how the machines operate. Now he is ready to make profit of his findings.
BILL已经发现一种玩堵博机(*)赚钱的绝佳方式,经过几个月的仔细研究之后,他最终弄明白了这种机器如何工作的算法,现在他打算为自己的发现创造利润。
But first an introction to the game. A slot machine consists of a number of wheels, usually three or four, each with a number of symbols printed on it – cherries, oranges, bells, etc. – and will show one of its symbols at a given time. To play, you insert a coin, push a button and the wheels start spinning. After spinning for a while, each wheel stops – at random it seems – at one of its symbols. If all wheels stop at the same symbol, or some nice combination of symbols, the player wins. One combination that is especially desirable is having the jackpot symbol on all wheels. This combination is simply called ’jackpot’ and will make you rich for life.
首先,介绍一下这个游戏(原理), 一个堵博机是由多个轮盘组成,通常是三到四个, 每个轮盘有许多图案印在上面,——樱桃,桔子,铃铛等等, 并且会在规定的时间显示其中的一个图案。 (如果)你想玩游戏, 塞入一个游戏币,按下按钮,轮盘开始旋转。 转了一段时间之后, 每个轮盘会停在貌似随机的一个图案上,或者一些不错的图案组合, 那么玩家就赢了。 有一种最佳的(图案)组合是在所有轮盘上得到“jackpot”图案,这种组合为简称为“Jackpot” 它会让你终身致富的。
What Bill has discovered is that each wheel will stop at the jackpot symbol with a certain periodicity, which differs a lot between wheels. He has also figured out (after some sneaking around at the slot-machine factory) that all newly manufactured slot-machines are delivered showing the jackpot combination, and that they all have a counter at the back, telling how many times the machine has been played. This counter is always set to zero at delivery.
BILL发现每个轮盘会以某个特定的周期停在“jackpot”图案上面,每个轮盘的周期并不相同。 他也发现所有出厂的堵博机都会被设置成显示“Jackpot”组合,并且他还发现所有的机器的背后都有一个计数器(在多次在堵博机工厂周围偷偷观察之后),可以识别机器被使用过多少次,这个计数器通常会在出厂时清零。
Now, all Bill needs to do is to calculate the number of times a machine has to be played between two occurrences of the jackpot combination. We will call this number the jackpot periodicity. This is of course the same as the number of times the machine has to be played after leaving the factory, before it gives its first jackpot. Thus, with a glance at the counter on the back of a machine, Bill can figure out if it is about to give a jackpot.
现在,BILL需要做的是计算一台机器在出现两次“Jackpot”组合之间被使用过的次数。我们管这个数字叫”Jackpot”周期。 这个数字肯定是与机器离开工厂之后,且第一次出现“Jackpot”组合之前,被使用过的次数相同。 所以,BILL只要瞥一眼一台机器后面的计数器,就能知道它是否会出现”Jackpot”(图案)。
As Bill knows that you are a skillful computer programmer, he turns to you with the problem of calculating the jackpot periodicity. For each machine, he will give you the number of wheels, and the periodicity with which the jackpot symbol shows up on each wheel.
Input 输入
据BILL所知,你是一名出色的编程员,他向你求助解决“Jackpot”周期计算的问题。 他会给你每台机器的轮盘数和每个轮盘显示”Jackpot”图案的周期。
One line with the number of machines n ≤ 20. For each machine, one line with the number of wheels w ≤ 5, and one line with w numbers, p1, ..., pw the periodicity of each wheel pk ≤ 1000.
机器数量 N小于等于20. ,每台机器的轮盘数W小于等于5, 每个轮盘周期 PK小于等于1000
(And one line with w numbers, p1, ..., pw, 没看懂)
Output 输出
One line per machine: The jackpot periodicity of the machine, if it is less than or equal to a billion (109), otherwise output the text ’More than a billion.
每台机器的“JACKPOT”周期,如果小于或等于10亿次,否则输出结果大于十亿次。
热心网友
时间:2023-10-17 12:14
说明
条例草案已经找到了完美的方式来赚钱玩*。经过几个月的仔细研究,他终于找到了背后的力学如何运作的机器。现在,他是准备赚取利润的结果。
但是,首先介绍了比赛。阿*包含了若干轮毂,通常三或四个,每一个号码的符号印上它-樱桃,桔子,铃铛等-和会显示它的一个符号在某一特定时间。发挥你插入一个硬币,按一个键,车轮开始纺纱。后纺一段时间,每个车轮站-随机看来-在它的一个符号。如果所有的轮子停止在同一符号,或一些不错的组合的符号,球员的胜利。一个组合,尤其是可取的是具有象征大奖的所有车轮。这种结合就是所谓的'奖金' ,将让你丰富的生活。
什么条例草案已发现的是,每个车轮会停止在中奖符号具有一定的周期性,其中很多不同的车轮。他还计算出(后周围的一些sneeking在槽机械厂) ,所有新生产的槽机的交付显示了头奖的组合,而且他们都有一个柜台后面,告诉多少次的机器一直发挥。此计数器总是设置为零时交付。
现在,所有法案需要做的是计算的次数机器将发挥两国之间出现的中奖组合。我们将拨打此号码中奖周期。当然,这是相同的次数机器将发挥后离开工厂之前,它使第一大奖。因此,一目了然在柜台的背面一台机器,比尔也摸索出如果它是给予大奖。
正如比尔知道,你是一个熟练的计算机程序员,他把你的问题,计算中奖周期。对于每一个机器,他会给你的人数轮毂,并定期与中奖符号出现在每个车轮。
输入
一个符合多台机器ñ ≤ 20 。对于每一个机器,一个符合若干车轮瓦特≤ 5 ,一个符合瓦特号码, P1的... ,啊的周期每个车轮峰≤ 1000 。
输出
每一条线机:中奖周期的机器,如果是小于或等于10亿( 109 ) ,否则输出的文字,有10亿以上。