Recently, I feel the strength of State compression dp (it is critical to make flexible use of binary operations )... So let's take a look .. After all, my teammates are professional DP players. I just have a look at it .. I will have the opportunity to play with it in the future... PS: If the sky gives me another chance, I would like to select the status DP instead of the network stream (only for the current competition)
Classic problem: the number of non-adjacent/banned points. Poj3254
# include # include using namespace STD; int n, m; int DP [5000] [15]; int Yu [5000]; int numstate = 0; int fib [15]; void Init () // n rows of M columns, status one row of push {scanf ("% d", & N, & M); int Maxs = (1
HDU 5045, which sort is optimal. Complexity from n! -- "2 ^ N * n.
# include # include # include # include using namespace STD; int n, m; double DP [1040] [12]; // DP [State] [I] achieves the current optimal condition of the I state. Int numstate = 0; Double A [12] [1005]; int main () {int t; scanf ("% d", & T); int CNT = 1; while (t --) {scanf ("% d", & N, & M); For (INT I = 1; I <= N; I ++) for (Int J = 1; j <= m; j ++) scanf ("% lf", & A [I] [J]); double sums = 0; for (int ii = 0; II
Status compression DP poj 3254 hdu5045