ZOJ Problem Set - 1007 Numerical Summation of a Series
来源:互联网 发布:2d旋转矩阵 编辑:程序博客网 时间:2024/04/29 03:48
ZOJ Problem Set - 1007
Numerical Summation of a Series
文章来源
这道题基本算是纯数学题,下次见到类似的记得不要慌!
假设n是要达到精度要求的要计算到的数:
到这里就差不多了,e*中我觉得只要考虑后面部分就可以了,在大于n时是小于1/(3*n^3)的,在n达到4次方的数量级时,误差就小于10^-12了,所以计算的次数就在10000以内了,开始的时候为了保险,开了100000,6秒多过了,后来一步步往下降,到8000也可以,0.5秒多,5000就不行,中间就没试了,没意思的,反正是达不到一大片人的0.00s,0.01s了,郁闷~~~~~
#include<stdio.h>int main(){ double sum,x,k; int i; x=0.000; for (i=0;i<=2000;i++) { sum=0.0; for (k=1;k<8000;k++) sum+=1/(k*(k+1)*(k+2)*(k+x)); sum=((2-x)*sum+0.25)*(1-x)+1; printf("%5.3f %16.12fn",x,sum); x+=0.001; } return 0;}
0 0
- ZOJ Problem Set - 1007Numerical Summation of a Series
- ZOJ Problem Set - 1007 Numerical Summation of a Series
- zoj 1007 Numerical Summation of a Series
- zoj 1007 Numerical Summation of a Series
- ZOJ 1007 Numerical Summation of a Series
- ZOJ 1007 Numerical Summation of a Series
- ZOJ 1007 Numerical Summation of a Series
- ZOJ 1007Numerical Summation of a Series
- ZOJ--1007:Numerical Summation of a Series
- zoj 1007 Numerical Summation of a Series 纯数学题
- ZOJ 1007 Numerical Summation of a Series (数学)
- Numerical Summation of a Series
- Numerical Summation of a Series
- ACM Numerical Summation of a Series (ZOJ-1007) 的N阶求解算法
- ZOJ1007 Numerical Summation of a Series
- ZOJ1007.Numerical Summation of a Series
- zoj1007-Numerical Summation of a Series
- zoj1007 Numerical Summation of a Series
- [INS-06006] Passwordless SSH connectivity not set up
- 并发无锁队列学习(数据结构)
- 与时间有关的类和方法
- hdu Robberies (背包)
- App8_08_getClass
- ZOJ Problem Set - 1007 Numerical Summation of a Series
- hdu I NEED A OFFER! (背包)
- App8_10_抽象类abstract
- 酒肉穿肠过 佛祖心中留...
- 安卓实习第八天
- App8_12_利用接口实现多重继承
- 2015年7月24日笔记
- hdu An easy problem (背包)
- (八十五)应用程序间的跳转与消息传递