摘要: 第一道三分题,有模板#define eps 10e-6double cal(){}//计算题目所需要的值while(l+eps#include #include #include using namespace std;const double PI=3.141592653;const double... 阅读全文
posted @ 2015-02-04 21:44 chenjunjie1994 阅读(158) 评论(0) 推荐(0) 编辑
摘要: 看了题解那个弱化版后,马上就去做了HDU 3333这道题,发现有可用的地方。于是往这方面想,主要是处理如何确定一个数出现K次的问题。想到了从左往右把每个数出现的次数记下来,但感觉不是这样,呃,再看别人做的,真的是这样的--!主要是处理一个数出现K次后的情况,把每个数出现的位置记录下来,当出现大于等于... 阅读全文
posted @ 2015-02-04 15:15 chenjunjie1994 阅读(389) 评论(0) 推荐(0) 编辑
摘要: 和上题HDU 3333一样。#include #include #include #include #include #define LL __int64#define lowbit(x) ((x)&(-x))using namespace std;const int N=60050;const i... 阅读全文
posted @ 2015-02-04 13:37 chenjunjie1994 阅读(155) 评论(0) 推荐(0) 编辑
摘要: 求一个区间内不同数的和。这相当于求一个区间的不同数的个数。使用树状数组,离线算法,离散化,把所有要询问的区间读入,然后按区间的右端点排序。对数组从左往右扫描,设当前数字为V,记录下V上一次出现在数组的位置last[V],然后把上一次的位置last[v]在树状数组减去V,在当前位置加上V。当扫描到区间... 阅读全文
posted @ 2015-02-04 12:45 chenjunjie1994 阅读(158) 评论(0) 推荐(0) 编辑