Loading

摘要: HDU 1260 Tickets 大意: 给出n个人买票的时间以及他们每个人和下一个人合买双人票的时间,问最早什么时候能卖完票 思路: $dp[i]$代表前i个人买完票需要多久,那么可以从$dp[i-2]$转移过来,也可以从$dp[i-1]$转移过来 #include <bits/stdc++.h> 阅读全文
posted @ 2020-12-25 20:26 dyhaohaoxuexi 阅读(77) 评论(0) 推荐(0) 编辑
摘要: 大意: 有n个馅饼在不同的时间会落到0到10的区间内,初始位置为5,每秒只能移动一米,问最多能接到多少馅饼 思路: 既可以正着写也可以反着写,正着写的话需要判断能否达到这个点,反着写就无所谓了 正着写: #include <bits/stdc++.h> using namespace std; co 阅读全文
posted @ 2020-12-25 20:25 dyhaohaoxuexi 阅读(73) 评论(0) 推荐(0) 编辑
摘要: 大意: 给出储钱罐的罐重和总重,以及m种硬币的数量和面值,问符合条件(即硬币重量=总重-罐重)的硬币最小的面值和为多少 思路: 完全背包,容量为总重-罐重,价值为硬币的面值 #include <bits/stdc++.h> using namespace std; const int N = 1e4 阅读全文
posted @ 2020-12-25 00:57 dyhaohaoxuexi 阅读(75) 评论(0) 推荐(0) 编辑
摘要: 大意: 求最大权值上升子序列 思路: 把最大上升子序列的板子改改就行,dp[i]代表以i为结尾的上升子序列的权值 #include <bits/stdc++.h> using namespace std; const int N = 1e6 + 5; typedef long long LL; in 阅读全文
posted @ 2020-12-25 00:38 dyhaohaoxuexi 阅读(84) 评论(0) 推荐(0) 编辑