大家帮我翻译一下这题,谢谢!!
发布网友
发布时间:2022-05-04 11:35
我来回答
共2个回答
热心网友
时间:2022-06-21 12:34
Once a gasoline meter broke at a filling station. Fortunately, there was an overflow clipper (a device that makes it possible not to overfill a tank).
An ACM-programmer came to this station and saw an announcement saying that the station didn't work properly. As he was meditating on what to do next, he noticed three empty cans at the station's counter. He thought: "If I fill the first can and then empty it to the second one, and then take the third one… Maybe, I'll be able to measure out the needed amount of gasoline?"
As usual, he began to think about a general formulation of the problem, forgetting the partial case: "How many different capacities can I measure out using these cans?"
Of course, it is forbidden to spill gasoline because of ecology reasons. Also, the station's owner requires that gasoline only be transferred from the storage tank to a can or between cans. The car's tank may be filled from one or several of the cans only after all of the transfers.
Input
Each of the three input lines contains an integer from 0 to 255, which is the capacity of a gasoline can in liters.
Output
The result is an integer that is the number of different answers to the question how many liters the programmer can measure out using the gasoline cans with the specified capacities.
Sample
input
0
3
4
output
6
Hint
There is no sense to measure out 0 liters, so this value must not be counted.
一道数学计算题~~
有一个汽油计在加油站损坏,幸运的是有一个遗漏限幅计(一个防止汽油不漏出油箱的设备)。
一位 ACM程序员来到加油站,看到一个写着加油站不能正常运作的布告。当他在思考接下来该做什么的时候,他注意到在加油站角落有三个空罐。他想,“如果我用油将第一个罐子填满,然后将它全部倒入第二个罐子,接着我用第三个罐子...也许我可以计算出需要的汽油量。
像往常一样,他开始思考这个问题的一般方程式,不考虑特殊情况."我可以利用这些罐子计算出多少种不同的容积呢?”当然,就保护生态的角度,汽油泄漏是被禁止的。同样,加油站的负责人要求汽油只能由储油罐转移到罐子中,或在罐子之间转移。车的油箱只有在这些传输后才有可能被其中一个或几个罐子填满。
输入
三个输入管道各可容纳0-255整数的油量,那么油箱的容积是多少立升?
输出
结果是程序员可以用油罐计算出多少种具体容量的整数数字。
例子
输入
0
3
4
输出
6
提示 计算出0立升没有意义,所以此值不予考虑。
应该能明白吧 希望能帮到你~
热心网友
时间:2022-06-21 12:34
是个计算问题,我简单帮您翻译了一下,仅供参考。
Once a gasoline meter broke at a filling station. Fortunately, there was an overflow clipper (a device that makes it possible not to overfill a tank).
一个汽油加油站的汽油计量表坏了,幸运的是这个油站装配了一个溢流截至阀。(一种安装在储罐中的防止溢流的装置)。
An ACM-programmer came to this station and saw an announcement saying that the station didn't work properly. As he was meditating on what to do next, he noticed three empty cans at the station's counter. He thought: "If I fill the first can and then empty it to the second one, and then take the third one… Maybe, I'll be able to measure out the needed amount of gasoline?"
刚好一个ACM(可能是美国计算机协会的简写)的程序员刚好来到这个加油站并且看到了这个加油站不能正常工作的告示。他正在考虑该怎么办的时候他注意到在这个加油站的柜台上放着三个空铁罐。他想:“如果我把第一个铁罐加满然后再倒入第二个铁罐里,然后用第三个。。。也许我就能计算出我需要添加的汽油量了吧?
As usual, he began to think about a general formulation of the problem, forgetting the partial case: "How many different capacities can I measure out using these cans?"
跟平时一样,他开始思考解决问题的公式:“究竟我可以用这些铁罐估算出多少不同的添加量呢?”(意思就是说他想用这些铁罐的组合得到不同容积的汽油添加量)
Of course, it is forbidden to spill gasoline because of ecology reasons. Also, the station's owner requires that gasoline only be transferred from the storage tank to a can or between cans. The car's tank may be filled from one or several of the cans only after all of the transfers.
当然,因为环保的原因,汽油是不能随意倾倒的。同时加油站的老板要求汽油只能在储罐和铁罐或者铁罐之间操作。在这样的操作过后,只能用一个铁罐或者几个铁罐为汽车加油。
Input
输入
Each of the three input lines contains an integer from 0 to 255, which is the capacity of a gasoline can in liters.
每个输入管道可以输出包含从0-255升每个整数倍的汽油,每个铁罐的最大容积也是255升。
Output
输出
The result is an integer that is the number of different answers to the question how many liters the programmer can measure out using the gasoline cans with the specified capacities.
计算结果则为这个程序员通过对铁罐的操作所能获得的不同的添加量。
Sample
举例
input
输入
0
3
4
output
输出
6
Hint
提示
There is no sense to measure out 0 liters, so this value must not be counted.
因为无法计量0升,所以这个情况不考虑在内。