摘要:
"城市交通路网" 最短路 + 路径输出 Code: c++ include include include include using namespace std; //Mystery_Sky // define M 1000100 define INF 0x3f3f3f3f struct Edge 阅读全文
摘要:
"友好城市" 对北岸(或南岸)的城市从小到大排序,再求南岸(或北岸)的城市位置的最长不下降序列长度即可。 ps:这里数据较弱,用n n的做法可以过。 Code: c++ include include include include using namespace std; //Mystery_Sk 阅读全文
摘要:
"购买巧克力Chocolate Buying" 乍一看以为是背包,然后交了一个感觉没错的背包上去。 结果无情30分。 看了一下数据范围,再仔细想了下,发现不是dp,贪心就可以了,从小到大排序费用,再从小到大买,到买不起为止即可。 Code: 阅读全文
摘要:
"机器分配" Code: c++ include include include using namespace std; //Mystery_Sky // define M 5000 int f[M][M]; int n, m, ans; int c[M][M]; void print(int i 阅读全文
摘要:
"开餐馆" 01背包的变式 Code: 阅读全文
摘要:
"分组背包" 分组背包模板题 Code: 阅读全文
摘要:
"宠物小精灵之收服" 二维费用背包 Code: c++ include include include include using namespace std; //Mystery_Sky // define M 5000 int f[M][M]; int n, m, k; int a[M], b[ 阅读全文
摘要:
"潜水员" 二维费用背包 Code: 阅读全文