摘要: 我觉得,给了初始点的话用bfs方便点,没有则dfs ||可能超片面 https://vjudge.net/contest/281085?tdsourcetag=s_pcqq_aiomsg#problem/C 1 #include<stdio.h> 2 #include<string.h> 3 #in 阅读全文
posted @ 2019-01-26 15:01 XXrl 阅读(155) 评论(0) 推荐(0) 编辑
摘要: https://vjudge.net/contest/281085?tdsourcetag=s_pcqq_aiomsg#problem/B 1 #include<stdio.h> 2 #include<string.h> 3 #include<math.h> 4 #include<iostream> 阅读全文
posted @ 2019-01-26 11:13 XXrl 阅读(197) 评论(0) 推荐(0) 编辑
摘要: dijkstra算法模板 http://acm.hdu.edu.cn/showproblem.php?pid=1874 1 #include<stdio.h> 2 #include<string.h> 3 #include<math.h> 4 #include<iostream> 5 #includ 阅读全文
posted @ 2019-01-25 14:01 XXrl 阅读(307) 评论(0) 推荐(1) 编辑
摘要: https://www.luogu.org/problemnew/show/P2801 第一次写分块的题,学习了这个视频: https://www.bilibili.com/video/av6445624?from=search&seid=16889343910066931739 1 void bu 阅读全文
posted @ 2019-01-24 18:24 XXrl 阅读(134) 评论(0) 推荐(0) 编辑
摘要: http://codeforces.com/contest/1104/problem/C 好厉害的题~ 只要把竖着的放在第一第二行,横着的放在第三/第四行就行。 哦吼,大半夜脑子迷糊地看英文的脑筋急转弯么? 1 #include<stdio.h> 2 #include<string.h> 3 #in 阅读全文
posted @ 2019-01-23 10:22 XXrl 阅读(282) 评论(2) 推荐(0) 编辑
摘要: 唔,第一次参加,掉了好多分。 http://codeforces.com/contest/1104/problem/B 不用考虑太多,string真的好厉害。 1 #include<stdio.h> 2 #include<string.h> 3 #include<math.h> 4 #include 阅读全文
posted @ 2019-01-23 09:43 XXrl 阅读(128) 评论(0) 推荐(0) 编辑
摘要: sum[i]是1-i所有1的和,而i-sum[a[i]]就是在a[i]后面的数,即在i之前出现,却比他大的数。1是加在a[i]上,即i实际应该放的位置。而c[i]是为sum做准备的 1 #include<stdio.h> 2 #include<string.h> 3 #include<math.h> 阅读全文
posted @ 2019-01-22 18:51 XXrl 阅读(173) 评论(0) 推荐(0) 编辑
摘要: http://codeforces.com/group/w1oiqifZbS/contest/1036/problem/C ①先查找,存入vector(dfs)-->排序(sort)-->二分(lower_bound,upper_bound) 1 #include<stdio.h> 2 #inclu 阅读全文
posted @ 2019-01-22 13:51 XXrl 阅读(147) 评论(0) 推荐(0) 编辑
摘要: 1 #include<stdio.h> 2 #include<string.h> 3 #include<math.h> 4 #include<iostream> 5 #include<stdlib.h> 6 #include<algorithm> 7 #include<queue> 8 #inclu 阅读全文
posted @ 2019-01-22 08:25 XXrl 阅读(164) 评论(0) 推荐(0) 编辑
摘要: https://cn.vjudge.net/contest/177260#problem/C stringstream :https://blog.csdn.net/xw20084898/article/details/21939811 学习:http://www.cnblogs.com/yjlbl 阅读全文
posted @ 2019-01-20 16:59 XXrl 阅读(204) 评论(0) 推荐(0) 编辑