uva 10341
摘要:又有好久没有写博客了,主要是没怎么做题,汗……有点小忙吧~~~这一题坑了我,我搞不懂编译器咋这么差,这等错误都找不出来,我勒个去啊~~~害惨我了……~~~~(>_<)~~~~View Code 1 #include <cstdio> 2 #include <cmath> 3 4 const double er = 1e-6; 5 double p,q,r,s,t,u; 6 7 inline double get_value(double x) 8 { 9 return p*exp(-x)+ q*sin(x) + r*cos(x) + s*tan(x) + t
阅读全文
posted @
2012-03-21 22:01
Shirlies
阅读(294)
推荐(0) 编辑
hdu 2438
摘要:数学啊!http://apps.hi.baidu.com/share/detail/16843204代码就不贴了,这一题让我惭愧,不说了……
阅读全文
posted @
2012-02-20 00:02
Shirlies
阅读(253)
推荐(0) 编辑
hdu 1969
摘要:这一题起初我连题目都没有看懂,汗,貌似最近自己对题目的理解有点障碍啊,得多多看书了,最好拿本英文书阅读,泪崩啊……郁闷中,理解题目了,但是没有头绪,不知道这一题哪里是二分题目了,茫然中搜了题解http://www.cnblogs.com/newpanderking/archive/2011/08/24/2152576.html自卑啊,也明白了并不是学到了什么就一定会用!要灵活变化啊~~~#include "stdio.h"#include "math.h"#define pi acos(-1.0)//!!#define er 1e-6double are
阅读全文
posted @
2012-02-19 21:03
Shirlies
阅读(614)
推荐(0) 编辑
hdu 2141
摘要:晕,这一题我是准备暴力的,但是这里给的数据有点大,那样是会TLE的,网上搜搜,无语啦,竟然可以这样来思考:合并前两个数组,然后再二分……#include "stdio.h"#include "stdlib.h"int li[505];int mi[505];int ni[505];int join[250005];int cmp(const void *a,const void *b){int *c,*d;c=(int *)a;d=(int *)b;return *c-*d;}int main(){int l,m,n;int s;int count=1;
阅读全文
posted @
2012-02-19 17:07
Shirlies
阅读(560)
推荐(0) 编辑
hdu 1597
摘要:这一题摔的有点惨,为嘛?首先是题目看错了,还以为是数据范围的问题,改成__int64,总共wa了两次,在仔细看题目,汗……我应该取模的,好吧,取了模,还是Wa了,额……怎么了,网上翻了别人的代码,哦哦,数据范围有问题,刚才改的时候,又改回成int了,好了,a了。其实这一题蛮简单的,就是找规律……#include "stdio.h"#include "math.h"int main(){int T;__int64 n,k;scanf("%d",&T);while(T--){scanf("%I64d",&
阅读全文
posted @
2012-02-19 15:33
Shirlies
阅读(459)
推荐(0) 编辑
hdu 2178
摘要:对这一题表示无语……#include "stdio.h"#include "math.h"int main(){int T;int n;scanf("%d",&T);while(T--){scanf("%d",&n);printf("%d\n",(int)pow(2,n)-1);}return 0;}
阅读全文
posted @
2012-02-19 12:31
Shirlies
阅读(156)
推荐(0) 编辑
hdu 2899
摘要:先求导,在二分……#include "stdio.h"#include "math.h"#define er 1e-4double get_equ(double x){return 42*pow(x,6)+48*pow(x,5)+21*x*x+10*x;}int main(){int T;double y;double mid,left,right;scanf("%d",&T);while(T--){scanf("%lf",&y);left=0;right=100;mid=50;while(fabs
阅读全文
posted @
2012-02-19 11:20
Shirlies
阅读(187)
推荐(0) 编辑
hdu 2199
摘要:基本的二分,但是我还是提交了几次,因为那个er开大了,超时了……#include "stdio.h"#include "math.h"#define er 1e-4//这里的er我起初开到了1e-7……超时了……int main(){int T;double n,t,u,d,a;scanf("%d",&T);while(T--){scanf("%lf",&n);n=n-6;if(n<0||n>(8*10000-100+3)*101*100){printf("No solutio
阅读全文
posted @
2012-02-19 10:33
Shirlies
阅读(260)
推荐(0) 编辑