2012年8月2日

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=2199找到方程的解,直接二分,注意精度View Code #include <iostream>using namespace std ;const double eps=1e-8 ;double f(double x){ return 8*x*x*x*x+7*x*x*x+2*x*x+3*x+6 ;}int main(){ int t ; double mid ; scanf("%d",&t) ; while(t--) { double y ; ... 阅读全文
posted @ 2012-08-02 20:38 LegendaryAC 阅读(197) 评论(0) 推荐(0) 编辑
 
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=3333离线算法,和上一题一模一样。。。View Code #include <iostream>#include <algorithm>#include <map>using namespace std ;const int maxn=30001 ;typedef __int64 LL ;#define lson l,m,rt<<1#define rson m+1,r,rt<<1|1map <int,int> hash ;struct n 阅读全文
posted @ 2012-08-02 20:37 LegendaryAC 阅读(108) 评论(0) 推荐(0) 编辑
 
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=3874今天和涂涂新学的离线算法,太牛了大概就是先接收所有数据,然后按查询右边界排序,从左往右更新,遇到之前加过的数就删掉,因为按右边界排序,所以查询区间不断右移,删掉不会出错View Code #include #... 阅读全文
posted @ 2012-08-02 20:35 LegendaryAC 阅读(273) 评论(0) 推荐(0) 编辑