摘要: #include#include#include#include#includeusing namespace std;#define MAXPRME 100000bool visit[MAXPRME+100];int prime[MAXPRME];//给定n,求所有>n) { ... 阅读全文
posted @ 2016-01-25 10:47 蓦辰 阅读(182) 评论(0) 推荐(0) 编辑
摘要: /*HDU 3473 Minimum Sum求询问区间内 所有数与中位数的差的绝对值的和*/#include#include#include#includeusing namespace std;const int MAXN=200010;int tree[20][MAXN];int sorted... 阅读全文
posted @ 2016-01-25 10:46 蓦辰 阅读(221) 评论(0) 推荐(0) 编辑
摘要: //复杂度log(n)#include #include #include #include #include #include #include #include #include #include #include #includeusing namespace std;#include con... 阅读全文
posted @ 2016-01-25 10:44 蓦辰 阅读(253) 评论(0) 推荐(0) 编辑
摘要: 简化版:(正int输入挂)int read(){ char ch=' '; int ans=0; while(ch'9') ch=getchar(); while(ch='0') { ans=ans*10+ch-'0'; ch=... 阅读全文
posted @ 2016-01-25 10:43 蓦辰 阅读(147) 评论(0) 推荐(0) 编辑
摘要: /**模版原题:PKU 3468*线段树*区间求和*/#include #include using namespace std;#define lson l , m , rt > 1)); // sum[rt*2]+=( add值*其旗下最终子节点个数); sum... 阅读全文
posted @ 2016-01-25 10:35 蓦辰 阅读(211) 评论(0) 推荐(0) 编辑
摘要: /***模版原题:HDU 1754*线段树-单点加减*区间求最值*/#include #define lson l , m , rt > 1; //m=(l+r)/2; build(lson); build(rson); PushUP(rt); //回溯更新父节点}//单点修... 阅读全文
posted @ 2016-01-25 10:34 蓦辰 阅读(117) 评论(0) 推荐(0) 编辑
摘要: #include #include using namespace std;#define DIGIT 4 //四位隔开,即万进制#define DEPTH 10000 //万进制#define MAX 251 //题目最大位数/4,要不大直接设为最大位... 阅读全文
posted @ 2016-01-25 10:31 蓦辰 阅读(156) 评论(0) 推荐(0) 编辑