给定n个整数(1<=n<=20),a1,a2,……,an,判断是否可以从中选取若干个数,使他们的和恰好为k(1<=ai,k<=10^8)
给定n个整数(1<=n<=20),a1,a2,……,an,判断是否可以从中选取若干个数,使他们的和恰好为k(1<=ai,k<=10^8)
多组测试数据
第一行两个整数n和k
第二行n个整数
能输出YES,不能输出NO
4 13
1 2 4 7
YES
Anything about this OnlineJudge, Please Contact Administrator. Click add QQ
OJ system based on HUSTOJ Project , UI based on Twitter Bootstrap
Copyright 2016 ACM算法攻关部cnt: 56043
关于网站改版