2016年5月20日

poj2528线段树解题报告,离散化+线段树

摘要: 题目网址:http://poj.org/problem?id=2528 题意: n(n<=10000)个人依次贴海报,给出每张海报所贴的范围li,ri(1<=li<=ri<=10000000)。 求出最后还能看见多少张海报。 输入: 通俗点说,离散化就是压缩区间,使原有的长区间映射到新的短区间,但是 阅读全文

posted @ 2016-05-20 10:47 远搏 阅读(248) 评论(0) 推荐(0)

2016年5月2日

STL中一些函数的应用

摘要: 1.nth_element():找到第几大的数。用法:nth_element(a,a+k,a+n),返回一个数组a中第k大的数,时间复杂度比较小,头文件#include <algorithm>。 2.lower_bound()。函数lower_bound()在first和last中的前闭后开区间进行 阅读全文

posted @ 2016-05-02 10:42 远搏 阅读(232) 评论(0) 推荐(0)

字符串处理sdut 2411

摘要: 题目:http://www.sdutacm.org/sdutoj/problem.php?action=showproblem&problemid=2411 关于字符串处理的题,此题坑点很多wr了好多便,但是学到了很多的用法:字符串有空格的输入输出,sscanf的用法等等; 还有一个浮点数精度的问题 阅读全文

posted @ 2016-05-02 10:31 远搏 阅读(140) 评论(0) 推荐(0)

2016年4月30日

poj1753模拟

摘要: 题目链接http://poj.org/problem?id=1573 题意:从第一行第k个出发按照已给的方向前进,问第几步走出去或第几步进入一个有多少步的循环。 就是按照题意模拟就好了。 代码写完了wa了好多次,最后找到坑点是把出发点标记成了0,导致错误。 错误数据:2 2 1 SW EN 阅读全文

posted @ 2016-04-30 10:34 远搏 阅读(158) 评论(0) 推荐(0)

2016年1月21日

最短路径Dijkstra模板

摘要: 算法思想:把所有的边分成两个集合A,B。集合A表示已经求出最短路径的点,不断扩展集合A,减少集合B。每一扩展就从结合B中找出到源点距离最短的点,加入到A。 dis[i]数组代表从出发点到j的距离; map[i][j]代表i到j的距离; 调用函数是需要把map初始化成正无穷; 阅读全文

posted @ 2016-01-21 14:37 远搏 阅读(180) 评论(0) 推荐(0)

2015年10月17日

poj 2777 线段树

摘要: Count ColorTime Limit:1000MSMemory Limit:65536KTotal Submissions:40116Accepted:12103DescriptionChosen Problem Solving and Program design as an optiona... 阅读全文

posted @ 2015-10-17 17:42 远搏 阅读(121) 评论(0) 推荐(0)

大数相加减以及相乘模板

摘要: 相乘 阅读全文

posted @ 2015-10-17 16:42 远搏 阅读(355) 评论(0) 推荐(0)

2015年10月8日

poj 3126 Bfs

摘要: Prime PathTime Limit:1000MSMemory Limit:65536KTotal Submissions:14539Accepted:8196DescriptionThe ministers of the cabinet were quite upset by the mess... 阅读全文

posted @ 2015-10-08 17:37 远搏 阅读(148) 评论(0) 推荐(0)

2015年9月26日

poj 3687 拓扑排序

摘要: DescriptionWindy hasNballs of distinct weights from 1 unit toNunits. Now he tries to label them with 1 toNin such a way that:No two balls share the ... 阅读全文

posted @ 2015-09-26 14:29 远搏 阅读(199) 评论(0) 推荐(0)

2015年9月24日

poj 1094 拓扑排序

摘要: DescriptionAn ascending sorted sequence of distinct values is one in which some form of a less-than operator is used to order the elements from smalle... 阅读全文

posted @ 2015-09-24 20:28 远搏 阅读(135) 评论(0) 推荐(0)

导航