上一页 1 2 3 4 5 6 7 8 9 ··· 12 下一页
摘要: http://codeforces.com/contest/1005/problem/E1 题目 https://blog.csdn.net/haipai1998/article/details/80985281 原博客 对样例1: m=4,所以下标pos=2; 从pos往右遇到比m大的就cnt++ 阅读全文
posted @ 2018-08-15 16:13 木流牛马 阅读(115) 评论(0) 推荐(0) 编辑
摘要: 思路1: https://blog.csdn.net/qq_41730082/article/details/80984316 题目的意思是给你一串数字长度为(1~2e5),当然由于它的这一串数字是不打空格的输入,所以我用了string 定义了个字符串然后仅需要对字符串操作即可。题目要求得到的是:给 阅读全文
posted @ 2018-08-15 10:48 木流牛马 阅读(173) 评论(0) 推荐(0) 编辑
摘要: 浅谈拓扑排序(基于dfs算法) 算法总结之拓扑排序 阅读全文
posted @ 2018-08-14 13:45 木流牛马 阅读(93) 评论(0) 推荐(0) 编辑
摘要: 我的参考的博客地址 题目 逆向考虑。 暴力遍历 k(k是1到n/2+1 范围内的),挑出对于每一个k,记对于党派 i,num[ i ]为其票数。num[ i ]小于k-1的就不用改变投票了(这部分是比较贵的),而 >=k-1的,都让他们投票给党派1(这部分是比较便宜的),这意味着要逆着贪心 简言之, 阅读全文
posted @ 2018-08-13 14:49 木流牛马 阅读(157) 评论(0) 推荐(0) 编辑
摘要: http://codeforces.com/group/1EzrFFyOc0/contest/706/problem/D 题目:就是有3种操作 + x向集合里添加 x - x 删除x元素,(保证存在 ? x 查询 x | 集合中元素的最大值 思路:就是利用字典树,从高位到低位进行贪心。 比如说给一个 阅读全文
posted @ 2018-08-09 17:36 木流牛马 阅读(109) 评论(0) 推荐(0) 编辑
摘要: https://www.cnblogs.com/TheRoadToTheGold/p/6290732.html 这个博客最后还有几道 字典树的模板题 这是一道 对于每个提问,给出以该字符串为前缀的单词的数量 阅读全文
posted @ 2018-08-09 14:05 木流牛马 阅读(81) 评论(0) 推荐(0) 编辑
摘要: https://blog.csdn.net/niteip/article/details/7444973 阅读全文
posted @ 2018-08-07 19:21 木流牛马 阅读(53) 评论(0) 推荐(0) 编辑
摘要: https://www.luogu.org/problemnew/show/P188 从前往后的做法: 从后往前的做法: 阅读全文
posted @ 2018-08-06 17:34 木流牛马 阅读(126) 评论(0) 推荐(0) 编辑
摘要: https://www.luogu.org/problemnew/show/P1140 阅读全文
posted @ 2018-08-06 15:16 木流牛马 阅读(173) 评论(0) 推荐(0) 编辑
摘要: https://www.luogu.org/problemnew/show/P1280#sub 题目 阅读全文
posted @ 2018-08-06 14:23 木流牛马 阅读(109) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 ··· 12 下一页