Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
这个题缩小规模之后就一定要用乱搜的?我用填表的做交10次错10次啊!填表部分是这个样子: a[1..6] = 输入 int tab[1000] = {0, 0, ...}; tab[0..a[1]] = 1; 之后 m=a[i];//最后一个1的位置 for i=2 to 6 { for j=1 to a[i] { for k=0 to m tab[k+i*j] |= tab[k] } m+=i*a[i]; } 然后判断tab[sum/2]是不是1 Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator