------状态压缩
_zhj
加油!
展开
-
HDU4909 String
StringTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 524288/524288 K (Java/Others)Problem DescriptionYou hava a non-empty string which consists of lowercase English letters and原创 2017-05-29 15:11:18 · 260 阅读 · 0 评论 -
HDU1074 Doing Homework 状态压缩dp
Doing HomeworkTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 9867 Accepted Submission(s): 4718Problem DescriptionIgnatius ha原创 2017-08-13 10:27:51 · 299 阅读 · 0 评论 -
TSP问题(动态规划求解)HDU5067
问题描述:有n个城市,从第一个城市出发,每个城市只能走一次,再回到第一个城市,求最小代价。思路:使用动态规划,dp[i][j],其中i是压缩的状态,表示第i个城市是否已经走过,j表示第j个城市。dp[i][j]表示状态是i且当前所在的城市是j时最小代价。转移方程:dp[i|(1<<k)][k] = min(dp[i|(1<<k)][k], dp[i][j]+di...原创 2019-04-16 10:28:07 · 822 阅读 · 0 评论