虽然是一道还是算简单的DP,甚至不用滚动数组也能AC,数据量不算很大。对于N个数,每个数只存在两个状态,取 和 不取。容易得出状态转移方程:dp[i][j] = dp[i - 1][j ^ a[i]] + dp[i - 1][j];dp[i][j] 的意思是,对于数列 中前 i 个数字,使得 XOR...
分类:
移动开发 时间:
2014-12-04 17:30:06
阅读次数:
197
题目链接题意 : 给你n个数,让你从中挑K个数(K 2 #include 3 #include 4 #define LL long long 5 using namespace std ; 6 int a[41] ; 7 LL dp[41][1 = m)30 {3...
分类:
移动开发 时间:
2014-12-04 13:48:35
阅读次数:
155
Happy Matt FriendsTime Limit: 6000/6000 MS (Java/Others)Memory Limit: 510000/510000 K (Java/Others)Total Submission(s): 418Accepted Submission(s): 159...
分类:
移动开发 时间:
2014-12-03 00:23:01
阅读次数:
176
Dr. Wong, Dr. Keough, Mrs.Novogroski, Ms. Curran, members of the board of education, familyand friends of the graduates, ladies and gentlemen of the W...
分类:
其他好文 时间:
2014-12-02 22:27:06
阅读次数:
362
Happy Matt Friends
Time Limit: 6000/6000 MS (Java/Others) Memory Limit: 510000/510000 K (Java/Others)
Total Submission(s): 150 Accepted Submission(s): 56
Problem Description
Matt has N f...
分类:
移动开发 时间:
2014-11-30 14:13:21
阅读次数:
237
Greedy Gift GiversA group of NP (2 ≤ NP ≤ 10) uniquely named friends has decided to exchange gifts of money. Each of these friends might or might not ...
分类:
其他好文 时间:
2014-11-30 13:49:47
阅读次数:
302
N*M暴力DP....
Happy Matt Friends
Time Limit: 6000/6000 MS (Java/Others) Memory Limit: 510000/510000 K (Java/Others)
Total Submission(s): 82 Accepted Submission(s): 34
Problem Descrip...
分类:
移动开发 时间:
2014-11-30 00:37:46
阅读次数:
206