文章分类 -  acm动态规划-状态压缩

hdu5067 状态压缩:经典旅行商问题
摘要:1 #include 2 #include 3 int dp[1050][15],a[55][55],x[15],y[15],dist[15][15]; 4 int mabs(int x) 5 { 6 return x>0?x:-x; 7 } 8 int main() 9 {10 ... 阅读全文

posted @ 2014-10-19 01:14 xiao_xin 阅读(131) 评论(0) 推荐(0)

hdu1074 状态压缩dp
摘要:1 #include 2 #include 3 char s[20][105]; 4 int ded[20],day[20],hash[40000]; 5 struct s 6 { 7 int time,pre,lost; 8 }dp[40000]; 9 void Print(int s... 阅读全文

posted @ 2014-07-22 14:17 xiao_xin 阅读(103) 评论(0) 推荐(0)

hdu1400 状态压缩dp
摘要:1 #include 2 #include 3 long long result[15][15],dp[15][2050]; 4 int n,m,t; 5 long long dfs(int l,int state) 6 { 7 int i,j,judge,flag,last; 8 ... 阅读全文

posted @ 2014-07-21 23:38 xiao_xin 阅读(158) 评论(0) 推荐(0)

导航