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

建议使用的浏览器:

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

5890:Eighty seven

题目描述
Mr. Fib is a mathematics teacher of a primary school. In the next lesson, he is planning to teach children how to add numbers up. Before the class, he will prepare $N$ cards with numbers. The number on the $i$-th card is $a_i$. In class, each turn he will remove no more than $3$ cards and let students choose any ten cards, the sum of the numbers on which is $87$. After each turn the removed cards will be put back to their position. Now, he wants to know if there is at least one solution of each turn. Can you help him?
输入解释
The first line of input contains an integer $t~(t \le 5)$, the number of test cases. $t$ test cases follow.
For each test case, the first line consists an integer $N(N \leq 50)$.
The second line contains $N$ non-negative integers $a_1, a_2, ... , a_N$. The $i$-th number represents the number on the $i$-th card. The third line consists an integer $Q(Q \leq 100000)$. Each line of the next $Q$ lines contains three integers $i,j,k$, representing Mr.Fib will remove the $i$-th, $j$-th, and $k$-th cards in this turn. A question may degenerate while $i=j$, $i=k$ or $j=k$.
输出解释
For each turn of each case, output 'Yes' if there exists at least one solution, otherwise output 'No'.
输入样例
1
12
1 2 3 4 5 6 7 8 9 42 21 22
10
1 2 3
3 4 5
2 3 2
10 10 10
10 11 11
10 1 1
1 2 10
1 11 12
1 10 10
11 11 12
输出样例
No
No
No
Yes
No
Yes
No
No
Yes
Yes
来自杭电HDUOJ的附加信息
Recommend wange2014

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

源链接: HDU-5890

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

共提交 0

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