CF2195A.Sieve of Erato67henes
入门
通过率:0%
时间限制:1.00s
内存限制:256MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
You are given n positive integers a1,a2,…,an.
Please determine if it is possible to select any number of elements in a, so that their product is 67.
Note that you may not select zero elements, as the product of zero elements is not defined in this problem.
给你 n 个正整数 a1,a2,…,an。
请判断是否能从数组 a 中选出任意多个元素,使得它们的乘积恰好为 67。
注意:你不能一个元素都不选,因为本题中未定义空集(零个元素)的乘积。
输入格式
Each test contains multiple test cases. The first line contains the number of test cases t (1≤t≤104). The description of the test cases follows.
The first line of each test case contains a single integer n (1≤n≤5).
The second line of each test case contains n positive integers a1,a2,…,an (1≤ai≤67).
每个测试包含多个测试用例。第一行包含测试用例的数量 t(1≤t≤104)。随后是各测试用例的描述。
每个测试用例的第一行包含一个整数 n(1≤n≤5)。
每个测试用例的第二行包含 n 个正整数 a1,a2,…,an(1≤ai≤67)。
输出格式
If it is possible to select elements so that their product is 67, output "YES" on one line. Otherwise, output "NO" on one line.
You can output the answer in any case. For example, the strings "yEs", "yes", and "Yes" will also be recognized as positive responses.
如果可以选择若干元素,使得它们的乘积为 67,则在一行中输出 "YES";否则,在一行中输出 "NO"。
你可以以任意大小写形式输出答案。例如,字符串 "yEs"、"yes" 和 "Yes" 也会被识别为肯定回答。
输入输出样例
输入#1
2 5 1 7 6 7 67 5 1 3 5 7 8
输出#1
YES NO
说明/提示
In the first test case, you can select a1 and a5 to get a1⋅a5=1⋅67=67.
In the second test case, it is impossible to select any number of elements so that their product is 67.
在第一个测试用例中,你可以选择 a1 和 a5,得到 a1⋅a5=1⋅67=67。
在第二个测试用例中,无法选择任意多个元素,使其乘积等于 67。
输入解题思路,AI测评打分。不知道怎么写?