状压dp
KEIke0
这个作者很懒,什么都没留下…
展开
-
Traveling by Stagecoach POJ 2686
用二进制表示你手上有哪些票,用掉一张就在对应二进制位置上把1变0 #include<cstdio> #include<iostream> #include<algorithm> #include<cstring> using namespace std; const int maxn=31; const int INF=0x3f3f3f; ...原创 2020-03-31 17:13:30 · 120 阅读 · 0 评论 -
方格取数(1) HDU 1565
没什么好说的,状压dp模板题 #include<iostream> #include<cstring> #include<algorithm> using namespace std; const int MAXN=25; const int dep=18000; int n; int map[MAXN][MAXN]; int dp[MAXN][dep...原创 2020-03-30 18:53:10 · 167 阅读 · 0 评论 -
炮兵阵地 POJ 1185
挺简单的,只要理解了状态dp大概这道题就不算难,只是考虑的情况要多一点 #include <cstdio> #include <iostream> #include <cstring> #include <algorithm> using namespace std; const int N = 105; int Map[N]; int dp[...原创 2020-03-27 17:16:44 · 143 阅读 · 0 评论 -
Hie with the Pie POJ 3311
#include<iostream> #include<algorithm> #include<cstring> using namespace std; const int MAXN=20; const int INF=0x3f3f3f3f; int dis[MAXN][MAXN]; int dp[1<<MAXN][MAXN]; int ...原创 2020-03-24 15:49:58 · 158 阅读 · 0 评论 -
Corn Fields POJ 3254
#include<iostream> #include<algorithm> #include<cstring> using namespace std; const int ted=1<<13; const int mod=100000000; int st[ted],map[ted],dp[20][ted]; int n,m; int l...转载 2020-03-19 09:58:01 · 135 阅读 · 0 评论