USACO Prime Cryptarithm Accepted
来源:互联网 发布:送女朋友什么口红知乎 编辑:程序博客网 时间:2024/06/05 23:50
TASK: crypt1LANG: CCompiling...Compile: OKExecuting... Test 1: TEST OK [0.004 secs] Test 2: TEST OK [0.004 secs] Test 3: TEST OK [0 secs] Test 4: TEST OK [0.004 secs] Test 5: TEST OK [0.004 secs] Test 6: TEST OK [0.004 secs] Test 7: TEST OK [0.004 secs]All tests OK.YOUR PROGRAM ('crypt1') WORKED FIRST TIME! That's fantastic-- and a rare thing. Please accept these special automatedcongratulations.
Here are the test data inputs:
------- test 1 -------52 3 4 6 8------- test 2 -------42 3 5 7------- test 3 -------11------- test 4 -------74 1 2 5 6 7 3------- test 5 -------89 1 7 3 5 4 6 8------- test 6 -------61 2 3 5 7 9------- test 7 -------91 2 3 4 5 6 7 8 9----------------------Keep up the good work!
Thanks for your submission!
枚举100-999乘10-99,这个过程中分别判断产生的竖式中每一项是否符合要求即可。
附题如下:
The following cryptarithm is a multiplication problem that can be solved by substituting digits from a specified set of N digits into the positions marked with *. If the set of prime digits {2,3,5,7} is selected, the cryptarithm is called a PRIME CRYPTARITHM.
* * * x * * ------- * * * * * * ------- * * * *Digits can appear only in places marked by `*'. Of course, leading zeroes are not allowed.
Write a program that will find all solutions to the cryptarithm above for any subset of digits from the set {1,2,3,4,5,6,7,8,9}.
PROGRAM NAME: crypt1
INPUT FORMAT
Line 1: N, the number of digits that will be used Line 2: N space separated digits with which to solve the cryptarithmSAMPLE INPUT (file crypt1.in)
52 3 4 6 8
OUTPUT FORMAT
A single line with the total number of unique solutions. Here is the solution for the sample input:
2 2 2 x 2 2 ------ 4 4 4 4 4 4 --------- 4 8 8 4
SAMPLE OUTPUT (file crypt1.out)
1
- USACO Prime Cryptarithm Accepted
- Prime Cryptarithm(USACO)
- USACO 1.3-Prime Cryptarithm
- [USACO] Prime Cryptarithm
- USACO 1.3 Prime Cryptarithm
- USACO Prime Cryptarithm
- usaco Prime Cryptarithm
- [USACO]Prime Cryptarithm
- USACO Prime Cryptarithm 杂水题
- USACO:Prime Cryptarithm
- usaco 1.3 Prime Cryptarithm
- USACO Prime Cryptarithm
- USACO-Prime Cryptarithm
- USACO Prime Cryptarithm
- USACO Prime Cryptarithm
- usaco Prime Cryptarithm (暴力)
- USACO 1.3 Prime Cryptarithm
- USACO Prime Cryptarithm
- OpenCms_Excel
- VB超频快餐,让我一次用个够!
- 两张名片和别人的20年
- Vmware和Xen在Linux虚拟化补丁上冲突
- 善待生命
- USACO Prime Cryptarithm Accepted
- 中国盛大拟出售所持新浪股份
- 存储过程翻页
- SqlServer安装失败
- J2EE4层体系结构
- SQL中char、varchar 和nchar、nvarchar的区别
- 新古典主义经济学的蠢话
- 基于J2EE的WEB应用快速开发构件平台--XFRAME
- 避免把判断处理放入 WHERE 条件