随笔分类 -  UVa

摘要:题意 判断数据结构类型 解析 直接模拟就行 cpp include using namespace std; const int maxn = 1e4 + 10; bool isstack, isque, ispri; struct Stack { int top, st[maxn]; void c 阅读全文
posted @ 2018-11-27 21:39 AlessandroChen 阅读(176) 评论(0) 推荐(0) 编辑
摘要:题目大意 大箱子能装小箱子,求在满足最少箱子的情况下,最小化每个箱子中最大的箱子个数. 解析 想到二分枚举箱子数,然后贪心的选择放进箱子的位置. 最优策略一定是将最大的 m 个先找出来,然后把剩下的放到这 m 个中, 我们发现子问题和上述问题是一样的, 所以贪心策略不变. 只需要判断这样贪心 阅读全文
posted @ 2018-11-24 11:55 AlessandroChen 阅读(217) 评论(0) 推荐(0) 编辑
摘要:解析 微扰法贪心经典题 代码 cpp include using namespace std; bool cmp(const string &x, const string &y) { return x + y y + x; } int main() { int n; while (~scanf(" 阅读全文
posted @ 2018-11-24 10:16 AlessandroChen 阅读(128) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示