摘要: 普通时间安排 HDU-2037 :http://acm.hdu.edu.cn/showproblem.php?pid=2037 选取结束时间早的策略。 #include <iostream> #include <algorithm> #include <vector> using namespace 阅读全文
posted @ 2019-02-08 21:52 czc1999 阅读(78) 评论(0) 推荐(0) 编辑
摘要: HDU 2527 :http://acm.hdu.edu.cn/showproblem.php?pid=2527 哈夫曼树,学完就忘得差不多了,题目的意思都没看懂,有时间复习下,看了别人的才知道是怎么回事。 贪心的题目,当总代价(要求最少)是由子代价累加或累乘出来,就可以考虑用哈夫曼来贪心。 题意: 阅读全文
posted @ 2019-02-08 19:49 czc1999 阅读(94) 评论(0) 推荐(0) 编辑
摘要: HDU-5969:http://acm.hdu.edu.cn/showproblem.php?pid=5969 一开始也是分了类,觉得要两种情况,l 与 r 位数相同与不同的情况,仔细想一下,可以一起处理,从最高位(左侧符号位)开始,遇到不同后面全部补1即可。 刚写好交信心满满,一交就Wrong a 阅读全文
posted @ 2019-02-08 16:47 czc1999 阅读(86) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2609 题目没看懂,就想百度找下,结果 多数人就写个 最小表示法,就po代码了,看了这个博主才明白题目是啥意思:https://blog.csdn.net/piaocoder/article/detail 阅读全文
posted @ 2019-02-08 14:24 czc1999 阅读(82) 评论(0) 推荐(0) 编辑
摘要: 一般想到的,将所有字符串是按字典序从小到大依次排下去。 但其实是错的,比如 b , ba按这个思想排出来,是 bba,但其实最小的是bab,就要改一下比较策略了,改成拼接之后,比较谁小。 int cmp(string s1,string s2) { return s1 + s2 < s2 + s1; 阅读全文
posted @ 2019-02-08 11:09 czc1999 阅读(210) 评论(0) 推荐(0) 编辑
摘要: LintCode 433: https://www.lintcode.com/problem/number-of-islands/description LintCode 434: https://www.lintcode.com/problem/number-of-islands-ii/descr 阅读全文
posted @ 2019-02-08 10:06 czc1999 阅读(175) 评论(0) 推荐(0) 编辑