上一页 1 ··· 34 35 36 37 38 39 40 41 42 ··· 73 下一页
摘要: 题目:https://www.lydsy.com/JudgeOnline/problem.php?id=1191 就是二分图匹配的裸题; 注意题目要求是第一次匹配失败就退出!没仔细看题差点丢失1A。 代码如下: 阅读全文
posted @ 2018-08-01 15:10 Zinn 阅读(144) 评论(0) 推荐(0) 编辑
摘要: 题目:https://www.lydsy.com/JudgeOnline/problem.php?id=4198 第一次写哈夫曼树!看了很多博客。 哈夫曼树 & 哈夫曼编码:https://www.cnblogs.com/xidongyu/p/6031518.html 这道题:http://www. 阅读全文
posted @ 2018-08-01 11:40 Zinn 阅读(192) 评论(0) 推荐(0) 编辑
摘要: 题目:https://www.lydsy.com/JudgeOnline/problem.php?id=1556 预处理出两个障碍四个方向之间的距离(转弯次数),就可以状压DP了; 但预处理很麻烦...参考了TJ...:https://blog.csdn.net/senyelicone/articl 阅读全文
posted @ 2018-08-01 10:02 Zinn 阅读(169) 评论(0) 推荐(0) 编辑
摘要: 题目:https://www.lydsy.com/JudgeOnline/problem.php?id=1045 好像是贪心...但这是一个环... 看博客:http://hzwer.com/2656.html 真是神奇的构造...还是应该大胆地先把各种变量都设出来再处理。 代码如下: 阅读全文
posted @ 2018-07-31 11:57 Zinn 阅读(142) 评论(0) 推荐(0) 编辑
摘要: 题目:https://www.lydsy.com/JudgeOnline/problem.php?id=1026 蛮简单的数位DP,预处理 f[i][j] 表示 i 位数,以 j 开头的 windy 数个数; 但不明白为什么最后一位拿出来特判 ret++ 不对,而写在循环里,特判 i==1 就对了. 阅读全文
posted @ 2018-07-31 11:43 Zinn 阅读(179) 评论(0) 推荐(0) 编辑
摘要: 题目:https://www.luogu.org/problemnew/show/P2668 https://www.luogu.org/problemnew/show/P2540 首先,如果没有顺子,那么有贪心最优解; 所以先搜索顺子,再贪心求剩余的出牌方案; 代码如下: 增强版要考虑拆牌,看了题 阅读全文
posted @ 2018-07-31 10:28 Zinn 阅读(184) 评论(0) 推荐(0) 编辑
摘要: 题目:bzoj 2005 https://www.lydsy.com/JudgeOnline/problem.php?id=2005 洛谷 P1447 https://www.luogu.org/problemnew/show/P1447 首先,题意就是求 ∑(1 <= i <= n) ∑(1 <= 阅读全文
posted @ 2018-07-30 00:23 Zinn 阅读(163) 评论(0) 推荐(0) 编辑
摘要: 题目:https://www.luogu.org/problemnew/show/P3112 状压DP...转移不错。 代码如下: 阅读全文
posted @ 2018-07-30 00:00 Zinn 阅读(176) 评论(0) 推荐(0) 编辑
摘要: 题目:https://www.luogu.org/problemnew/show/P1032 字符串好复杂...先写了个 dfs ,RE一个点TLE一个点,不知该怎么改了... #include<iostream> #include<cstdio> #include<cstring> #includ 阅读全文
posted @ 2018-07-28 17:56 Zinn 阅读(162) 评论(0) 推荐(0) 编辑
摘要: 题目:https://www.lydsy.com/JudgeOnline/problem.php?id=2252 又没能自己想出来... 一直在想如何从每个1开始广搜更新答案,再剪剪枝,什么遇到1就不走了... 然而实际上直接多源bfs,从所有1一起开始,因为只需要找到0碰到的第一个1即可; 这样搜 阅读全文
posted @ 2018-07-28 15:29 Zinn 阅读(165) 评论(0) 推荐(0) 编辑
上一页 1 ··· 34 35 36 37 38 39 40 41 42 ··· 73 下一页