本文共 1275 字,大约阅读时间需要 4 分钟。
题意:有m个城市,其中有些城市之间 有道路连通,且有一定的距离w,现在你有n张卡,每张卡有个权值t能让经过 通过 道路的费用变为w/t,求从城市a到城市b的 最小的花费。 #include #include #include #include #include #include #include #include
分析:状态压缩dp[s][u]表示在当前剩余票的情况为s(状压),所处城市为u的情况下所需要的最小的花费 不过还需要注意 本解法的枚举顺序,是先枚举当前票的状态...然后再是起点,使用的票,终点。 转载地址:http://dtgsi.baihongyu.com/