上一页 1 ··· 10 11 12 13 14 15 16 17 18 ··· 24 下一页
摘要: https://www.bnuoj.com/v3/contest_show.php?cid=9154#problem/C 【题意】 给定一个无向图,给定小偷的起始位置 从这个起始位置开始,小偷可以在单位时间内逃到相邻的点 问是否存在某一时刻,小偷可能到达这个无向图的任意点 【思路】 首先这个无向图必 阅读全文
posted @ 2017-07-16 16:47 shulin15 阅读(231) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=2444 【DFS染色】 1 #include<iostream> 2 #include<cstdio> 3 #include<cstring> 4 #include<string> 5 #include<cmath 阅读全文
posted @ 2017-07-16 16:02 shulin15 阅读(178) 评论(0) 推荐(0) 编辑
摘要: http://codeforces.com/contest/828/problem/C 【题意】 【思路】 因为题目保证一定有解,所有优化时间复杂度的关键就是不要重复染色,所以我们可以用并查集维护区间,把确定的点的父亲节点设为下一个点,这样访问过的点的根节点都是没访问过的点。 与上一题是同样的思路, 阅读全文
posted @ 2017-07-15 22:04 shulin15 阅读(243) 评论(0) 推荐(0) 编辑
摘要: http://codevs.cn/problem/1191/ 【思路】 每次我们染了一个区间,下一次如果还要染这个区间或者它的子区间的话,我们就不用处理了。这样我们可以把每一个区间抽象成一个点,用并查集来维护。合并时将[L,R]区间全部合并,[L,R]区间的每个点的父节点都通过路径合并变成L-1,然 阅读全文
posted @ 2017-07-15 20:50 shulin15 阅读(303) 评论(0) 推荐(0) 编辑
摘要: https://www.bnuoj.com/v3/problem_show.php?pid=25653 【题意】 给定一个3*3的九宫格,模拟一个停机坪。第一个格子一定是'*',代表take off area,其他的格子可能是'*','B','G'中的一种,'*'代表空地,'B','G'代表蓝色和绿 阅读全文
posted @ 2017-07-15 18:51 shulin15 阅读(259) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=1611 【Accepted】 1 #include<iostream> 2 #include<cstdio> 3 #include<algorithm> 4 #include<cstring> 5 #include <string> 6 usin 阅读全文
posted @ 2017-07-11 22:52 shulin15 阅读(137) 评论(0) 推荐(0) 编辑
摘要: http://codeforces.com/contest/612/problem/D 【题解】 http://blog.csdn.net/strokess/article/details/52248062 【题意】 在数轴x上,给定n个线段和一个值k,问被这n条线段覆盖了至少k次的区间有多少个,输 阅读全文
posted @ 2017-07-11 12:23 shulin15 阅读(190) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=5124 【题意】 在数轴x上,每次操作都覆盖一个区间的所有点,问被覆盖次数最多的点是覆盖了多少次 【思路】 最简单的扫描线,左右端点分别排序,遇到左端点sum++更新最值,遇到右端点sun--更新最值 【Accep 阅读全文
posted @ 2017-07-10 22:14 shulin15 阅读(144) 评论(0) 推荐(0) 编辑
摘要: 转自http://www.cnblogs.com/chanme/p/4457200.html H. Game Alice likes to play games. One day she meets such a game. There are N * N switches arranged in 阅读全文
posted @ 2017-07-09 20:53 shulin15 阅读(664) 评论(0) 推荐(0) 编辑
摘要: http://acmoj.shu.edu.cn/contest/27/problem/113/ 描述 有一天,空和白很无聊,决定玩盛大游戏,考虑到两个人玩,他们随便掏了一个游戏出来:在一个n∗m 的棋盘上,首先把史蒂芬妮·多拉放在左上角(1,1) 的位置。每次一个人可以将她往下,往右,往右下丢一格。 阅读全文
posted @ 2017-07-09 20:34 shulin15 阅读(266) 评论(0) 推荐(0) 编辑
上一页 1 ··· 10 11 12 13 14 15 16 17 18 ··· 24 下一页