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

建议使用的浏览器:

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

6020:MG loves apple

题目描述
MG is a rich boy. He has $n$ apples, each has a value of V($0<=V<=9$).

A valid number does not contain a leading zero, and these apples have just made a valid $N$ digit number.

MG has the right to take away $K$ apples in the sequence, he wonders if there exists a solution: After exactly taking away $K$ apples, the valid $N-K$ digit number of remaining apples mod $3$ is zero.

MG thought it very easy and he had himself disdained to take the job. As a bystander, could you please help settle the problem and calculate the answer?
输入解释
The first line is an integer $T$ which indicates the case number.($1<=T<=60$)

And as for each case, there are $2$ integer $N(1<=N<=100000)$,$K(0<=K$$<$$N)$ in the first line which indicate apple-number, and the number of apple you should take away.

MG also promises the sum of $N$ will not exceed $1000000$。

Then there are $N$ integers $X$ in the next line, the i-th integer means the i-th gold’s value($0<=X<=9$).
输出解释
As for each case, you need to output a single line.

If the solution exists, print”yes”,else print “no”.(Excluding quotation marks)
输入样例
2
5 2
11230
4 2
1000 
输出样例
yes
no
来自杭电HDUOJ的附加信息
Recommend wange2014

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

题目来源 BestCoder Round #93

源链接: HDU-6020

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

共提交 0

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