Sumsets Time Limit: 6000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3968 Accepted Submission(s): 1578 Problem Description Farmer John commanded his cows to search for different sets of numbers that sum t…
因为写不出hdu3401...好像要用单调队列优化...这边水了一个... 题意: 给n个房子涂色,给出n个房子对应颜色的花费,问涂完所有颜色花费最少. 保证相邻房子颜色不能相同. 思路: dp[i][j] 表前i个房子,第i个房子是j颜色的最少花费: #include<bits/stdc++.h> using namespace std; int dp[2][3]; int a,b,c,n; int main() { int T,cas=1; scanf("%d",&am…