首页 新闻 会员 周边

2014年ACM-ICPC西安邀请赛E题求大神解决

0
悬赏园豆:80 [已解决问题] 解决于 2014-07-25 10:11

来自HDU 4851

 

Description

Professor Doge is now working on a project using polynomial for some mathematical calculations. In his project, he wants to approximate the exponential function e x with a polynomial whose degree does not exceed n. As one of professor’s assistants, you are asked to find a polynomial f (x) with degree n that minimizes 
 

Input

There are several test cases, please process till EOF. 
Each test case consists of only one integer denoting the degree n of the polynomial (0 ≤ n ≤ 10).
 

Output

For each test case, print n + 1 lines. 
for the i-th line, print one floating number a i denoting the coefficient in the term x i, i = 0, 1, . . . , n. 
It is guaranteed that the answer is always unique. Any answer within an absolute error less than or equal to 10 -50 would be accepted.
 

Sample Input

0 1
 

Sample Output

1.7182818284590452353602874713526624977572470936999595749 0.8731273138361809414411498854106499910289883747998382998 1.6903090292457285878382751718840250134565174378002425501
 
 
最爱夏朵朵的主页 最爱夏朵朵 | 初学一级 | 园豆:132
提问于:2014-07-22 10:37
< >
分享
最佳答案
0

1.先是运用数值分析中的最逼近完全平方式

2.解线性方程组

3.控制值的计算,用同余迭代法精确到50位

最爱夏朵朵 | 初学一级 |园豆:132 | 2014-07-25 10:10

求代码实现

红烧春鸽 | 园豆:200 (初学一级) | 2014-08-18 03:10
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册