上一页 1 2 3 4 5 6 7 ··· 10 下一页
摘要: 题目链接:https://www.luogu.org/problemnew/show/P1939 对于矩阵推序列的式子: 由题意知: f[x+1] =1 f[x] + 0 f[x 1] + 1 f[x 2] f[x] = 1 f[x] + 0 f[x 1] + 0 f[x 2] f[x 1] = 0 阅读全文
posted @ 2018-09-14 21:06 Misaka_Azusa 阅读(144) 评论(0) 推荐(1) 编辑
摘要: 题目链接:https://www.luogu.org/problemnew/show/P4017 DAG + DP include include include include include using namespace std; const int maxn = 500010; const 阅读全文
posted @ 2018-09-14 21:00 Misaka_Azusa 阅读(129) 评论(0) 推荐(0) 编辑
摘要: 题目链接:https://www.luogu.org/problemnew/show/P1825 带有传送门的迷宫问题 阅读全文
posted @ 2018-09-13 18:01 Misaka_Azusa 阅读(173) 评论(0) 推荐(0) 编辑
摘要: 题目链接:https://www.luogu.org/problemnew/show/P2296 题意:给定起点终点,找一条从起点到终点的最短路径使路上的每个点都能有路径到达终点。 我们先反着建一遍图,然后从终点开始bfs一遍图,标记所有终点可以到达的点。然后再枚举一遍点,如果这个点是终点没法到达的 阅读全文
posted @ 2018-09-13 17:56 Misaka_Azusa 阅读(114) 评论(0) 推荐(0) 编辑
摘要: 题目链接:https://www.luogu.org/problemnew/show/P1351 做了些提高组的题,不得不说虽然NOIP考察的知识点虽然基本上都学过,但是做起题来还是需要动脑子的。 题目质量很高吧,觉得出的很有水平 ~~(除了2017 d1t1~~ 70分: 三层枚举强制到距离为2 阅读全文
posted @ 2018-09-13 17:46 Misaka_Azusa 阅读(117) 评论(0) 推荐(0) 编辑
摘要: include include include include using namespace std; const int maxn = 505000; int n, m, dis[maxn], vis[maxn], ans; struct edge{ int from, to, next, le 阅读全文
posted @ 2018-09-07 21:08 Misaka_Azusa 阅读(107) 评论(0) 推荐(0) 编辑
摘要: 题目链接:https://www.luogu.org/problemnew/show/P3623 说是对克鲁斯卡尔的透彻性理解 正解: 先考虑加入水泥路,然后再考虑加入剩下必须要加入的最少鹅卵石路。 之后对原图再跑最小生成树 先跑鹅卵石路到k条。 再从所有水泥路中直到成为最小生成树。 include 阅读全文
posted @ 2018-09-07 20:13 Misaka_Azusa 阅读(118) 评论(0) 推荐(0) 编辑
摘要: 题目连接:https://www.luogu.org/problemnew/show/P3950 1.像我这种学数据结构学傻了的 2.边权化点权 所有点权初始化0 3.对于战争 将深度较深的 1,对于和平 将深度较深的+1 4.对于历史 用war记录 5.特别注意 在两个查询的LCA处判断是否为 1 阅读全文
posted @ 2018-08-17 20:54 Misaka_Azusa 阅读(103) 评论(0) 推荐(0) 编辑
摘要: 题目链接:https://www.luogu.org/problemnew/show/P2762 算是拍照那个题的加强下。 输入真的很毒瘤。(~~都这么说但好像我的过了?~~) include include include include include define ll long long u 阅读全文
posted @ 2018-08-09 10:42 Misaka_Azusa 阅读(107) 评论(0) 推荐(0) 编辑
摘要: 题目链接:https://www.luogu.org/problemnew/show/P1402 菜 include include include include include using namespace std; const int maxn = 1e6 + 10; const int i 阅读全文
posted @ 2018-08-09 10:41 Misaka_Azusa 阅读(77) 评论(0) 推荐(0) 编辑
摘要: 题目链接:https://www.luogu.org/problemnew/show/P3410 这个题就是求一个最大权闭合图 在一个图中,一些点构成一个集合,且集合中的出边指向的终点也在这个集合中,则我们称这个集合为闭合图。 整个图中点的权值之和最大的闭合图,为最大权闭合图。 最大权闭合图可以用网 阅读全文
posted @ 2018-08-08 21:30 Misaka_Azusa 阅读(123) 评论(0) 推荐(0) 编辑
摘要: 题目链接:https://www.luogu.org/problemnew/show/P1231 对于每本书只能用一次,所以拆点再建边 include include include include include using namespace std; const int maxn = 5000 阅读全文
posted @ 2018-08-08 16:31 Misaka_Azusa 阅读(81) 评论(0) 推荐(0) 编辑
摘要: 题目链接:https://www.luogu.org/problemnew/show/P2936 菜 include include include include include using namespace std; const int maxn = 10000; const int inf 阅读全文
posted @ 2018-08-06 18:47 Misaka_Azusa 阅读(100) 评论(0) 推荐(0) 编辑
摘要: 题目链接:https://www.luogu.org/problemnew/show/P1343 菜 include include include include include using namespace std; const int maxn = 10000 + 10; const int 阅读全文
posted @ 2018-08-06 18:27 Misaka_Azusa 阅读(89) 评论(0) 推荐(0) 编辑
摘要: 题目链接:https://www.luogu.org/problemnew/show/P3931 肉眼观察题目感觉可以跑最大流。 证明是如果拆断一棵树,可以最小割,最小割等于最大流。 注意: 图是无向边,在网络流里建两次边,即四次。 统计一下叶子节点,再建一个超级汇点,所有距离为inf。 inclu 阅读全文
posted @ 2018-08-06 16:43 Misaka_Azusa 阅读(114) 评论(0) 推荐(0) 编辑
摘要: 题目链接:https://www.luogu.org/problemnew/show/P3275 把不等式 A B 转化成 A B = 1或者 B A include include include include define ll long long using namespace std; c 阅读全文
posted @ 2018-08-06 11:08 Misaka_Azusa 阅读(147) 评论(0) 推荐(0) 编辑
摘要: 题目链接:https://www.luogu.org/problemnew/show/P2947 因为在单调队列上被dalao们锤爆 怒刷单调队列题 何为单调队列? 设我们的队列为从左至右单调递增 对于样例数据 3 2 6 1 1 2 我们先把3入队 此时队列:3 再将2从后面入队 此时队列:2 3 阅读全文
posted @ 2018-08-05 20:19 Misaka_Azusa 阅读(134) 评论(0) 推荐(0) 编辑
摘要: 题目链接:https://www.luogu.org/problemnew/show/P1456 左偏树并查集不加路径压缩吧... include include include include using namespace std; const int maxn = 100000 + 10; s 阅读全文
posted @ 2018-08-05 15:40 Misaka_Azusa 阅读(132) 评论(0) 推荐(0) 编辑
摘要: 题目连接:https://www.luogu.org/problemnew/show/P3377 include include include include using namespace std; const int maxn = 300001 + 10; struct Left_Tree{ 阅读全文
posted @ 2018-08-05 10:54 Misaka_Azusa 阅读(101) 评论(0) 推荐(0) 编辑
摘要: 题目链接:https://www.luogu.org/problemnew/show/P1993 1.差分约束: 对于a b a 权值为c 对于a b = c 有一条 a—— b 权值为 c 对于一个差分约束系统,若存在负环则无解 2.dfs版SPFA判负环 include include incl 阅读全文
posted @ 2018-08-04 19:49 Misaka_Azusa 阅读(166) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 ··· 10 下一页
Live2D