The Ghost Blows Light Problem Description My name is Hu Bayi, robing an ancient tomb in Tibet. The tomb consists of N rooms (numbered from 1 to N) which are connected by some roads (pass each road should cost some time). There is exactly one route be…
比较裸的依赖背包,但是想状态还是想了好久 转移时由于边界问题,虽然可以倒序转移,但当容量为0|1的时候,由于有初始值的存在 很难再原dp数组上进行修改,所以额外用tmp数组来保存修改后的值 #include<bits/stdc++.h> #include<vector> using namespace std; #define mod 1000000007 #define ll long long #define maxn 100005 vector<int>G[max…