上一页 1 ··· 4 5 6 7 8 9 下一页
摘要: 题目:给出N(#include#include#include#include#includeusing namespace std;typedef long long ll;const int maxv=1e5+30;const ll mod=1000000007;int N;int a[10){... 阅读全文
posted @ 2015-05-22 22:35 PlusSeven 阅读(228) 评论(0) 推荐(0) 编辑
摘要: 题目:大意是有一个人从某个城市要到另一个城市(点数#include#include#include#include#include#include#include#define INF 0x3fffffff#define pb push_back#define pn(x) cerr>n>>m>>p>... 阅读全文
posted @ 2015-05-08 20:33 PlusSeven 阅读(133) 评论(0) 推荐(0) 编辑
摘要: 自己看了半天并没有看出这题怎么用尺取法(虽然一看就觉得肯定是尺取法。。),由于是绝对值,那么在计算的时候头和尾的实际位置并不重要,而应用尺取法这个数列肯定得是单调,那么我们把前缀和处理出来排序就可以直接应用尺取法了#include#include#include#include#include#in... 阅读全文
posted @ 2015-05-02 23:29 PlusSeven 阅读(206) 评论(0) 推荐(0) 编辑
摘要: 交了10多次,后来把二分的下界l从0改成-1就AC。。。。。无法理解啊。。。。。。。。。。。。PS:想通了。。。本来脑残想成只有N为0的时候才能dij才能取到0,但是因为能免费去边所以。。。下界必须取-1才能让上界可以取到0。。。真是脑残了。。。。#include#include#include#i... 阅读全文
posted @ 2015-05-02 17:38 PlusSeven 阅读(223) 评论(0) 推荐(0) 编辑
摘要: 开始写这个题的之后怎么写都些不对,而且因为考虑到分数相等的情况所以写的比较复杂(也可能是别的原因)一直WA,后来参考了大神的博客,其实对于这种二分的题目,如果有相等的情况,排个序人为加一个标准让所有元素可比就可以直接二分了嘛#include#include#include#include#inclu... 阅读全文
posted @ 2015-05-01 17:22 PlusSeven 阅读(198) 评论(0) 推荐(0) 编辑
摘要: 用优先队列扫一次得到大于和小于中位数的总和的最小值,再扫一遍得到最优解#include#include#include#include#include#include#define INF 0x3fffffffusing namespace std;typedef long long ll;int ... 阅读全文
posted @ 2015-05-01 16:23 PlusSeven 阅读(142) 评论(0) 推荐(0) 编辑
摘要: 二分中值,检查的时候继续二分,二分套二分。。。。。#include#include#include#include#include#includeusing namespace std;typedef long long ll;const int maxv=1e5+30;ll n;ll tol;ll... 阅读全文
posted @ 2015-04-29 23:04 PlusSeven 阅读(192) 评论(0) 推荐(0) 编辑
摘要: 参照了http://www.hankcs.com/program/cpp/poj-1065-wooden-sticks.html 代码写得很简洁#include#include#include#include#includeusing namespace std;typedef long long ... 阅读全文
posted @ 2015-04-29 17:43 PlusSeven 阅读(142) 评论(0) 推荐(0) 编辑
摘要: 必须优化dp数组,因为每次更新必须用到前一阶段和本阶段的数据,不能简单的把数组改成一维,我开了两个数组滚动使用#include#include#include#includeusing namespace std;const int maxv=1e5+30;int mod=1000000;int t... 阅读全文
posted @ 2015-04-28 22:09 PlusSeven 阅读(168) 评论(0) 推荐(0) 编辑
摘要: 楼教的男人八题名气甚大,今天做了一道感觉还是涨了不少姿势的,然而估计之后的每道题都要看题解吧,姑且先记录一下。以后再做再更1737Connected Graph1100LouTiancheng@POJ1738An old Stone Game407LouTiancheng@POJ1739Tony's... 阅读全文
posted @ 2015-04-28 22:06 PlusSeven 阅读(350) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8 9 下一页