当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

3419:The Three Groups

题目描述
There appeared in “Nouvelles Annales de Mathematiques” the following puzzle as a modification of any of my “Canterbury Puzzles.” Arrange the nine digits in three groups of two, three, and four digits, so that the first two numbers when multiplied together make the third. Thus, 12 * 483 = 5,796. I now also propose to include the cases where there are one, four and four digits, such as 4 * 1,738 = 6,952. Can you find all possible solutions in both cases?”- Amusement in Mathematics, by Ernest Dudeney.

Now we want to arrange some of the nine digits (without ‘0’) in three groups of a, b and c digits, so that the first two numbers when multiplied together make the third. In addition, no digit can be used more than once in a single multiplication. You have to find how many solution exist there for given a, b and c.
输入解释
There are multiple test cases. In addition, each test case is consisting of three integers a, b, c separated by spaces.(a , b , c >= 0 && a + b + c <= 9) Meaning of a, b, and c are described in the problem statement. The last case contains exactly three 0’s for all of a, b, c and indicates the end of input stream. This line should not be processed.
输出解释
Your program should print a single integer for each input in a single line. The integer will state that how many solution there are for the given size of a, b and c.
输入样例
2 3 4
1 1 1
0 0 0
输出样例
7
4


Note:
The valid solutions for the second sample input-output are as following:
2*3 =6
2*4 =8
3*2 =6
4*2 =8
来自杭电HDUOJ的附加信息
Author Muhammed Hedayet
Recommend lcy

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-3419

最后修改于 2020-10-25T23:03:21+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
2000/1000MS(Java/Others) 32768/32768K(Java/Others)