Problem Description Given a set of sticks of various lengths, is it possible to join them end-to-end to form a square?
Input The first line of input contains N, the number of test cases. Each test case begins with an integer 4 <= M <= 20, the number of sticks. M integers follow; each gives the length of a stick - an integer between 1 and 10,000.
Output For each case, output a line containing “yes” if is is possible to form a square; otherwise output “no”.
1 2 3 4 5 6 7 8 9 10 11 |
|
题意就是:看这个数组中的数字组合是否能够构成一个正方形 不能分割数字,不能重复组合
代码:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
|
本文章由[谙忆]编写, 所有权利保留。 欢迎转载,分享是进步的源泉。
转载请注明出处:http://chenhaoxiang.cn
本文源自【人生之旅_谙忆的博客】