风景区的面积及道路状况分析问题 test
参考文献: https://wenku.baidu.com/view/b6aed86baf1ffc4ffe47ac92.html
#include <bits/stdc++.h>
using namespace std;
const int maxn = ; double a[maxn][maxn]; int main ()
{
freopen("in.txt","r",stdin);
freopen("out.txt","w",stdout);
int n = ;
//int s = 0 ,t = 1,x;
//输入x 以及 y 的值
for(int i= ; i < n ; i++){
for(int j= ; j < ; j++){
cin >> a[i][j];
}
}// 读入数据 for(int j= ; j < n+ ; j++){
for(int i=j ; i < n ; i++){
a[i][j+] = 1.0* (a[i][j] - a[i-][j]) / (a[i][] - a[i-j][]);// + 0.00500000005;
}
}// 计算均差 printf("输出xi,yi及各阶均差\n");
printf(" Xi f(xi)\n");
for(int i= ; i < n ; i++){
cout << i << " ";
for(int j= ; j < i+ ; j++){
printf("%11.10lf ",a[i][j]);
}
cout << endl;
}// 打印均差表 printf("输出牛顿插值表达式\n");
printf("F%d(x)=\n",n);
for(int i= ; i < n ; i++)
{
if(i)
printf("+ ");
printf("%11.10lf",a[i][i+]);
for(int j= ; j < i ; j++)
printf("(x-%3.2lf)",a[j][]);
if(i == n)
break;
cout<< endl;
}
printf("\n");
}
牛顿插值法
0.1
6.54
4.76
5.19
6.65
4.53
9.51
4.99
12.17
2.21
15.23
6.81
17.35
6.10
19.21
8.89
22.15
4.88
23.46
3.72
27.11
3.21
28.81
2.78
29.87
3.58
30.52
2.28
30.99
2.11
32.01
2.47
33.85
2.26
34.91
1.55
37.5
样例输入1
1.7
19.89
4.80
24.52
5.98
34.82
8.83
40.54
12.18
37.67
15.21
41.38
17.92
30.00
19.50
19.68
22.23
14.56
24.56
18.86
27.31
17.98
29.11
21.62
29.87
17.98
30.87
14.86
31.51
12.86
32.89
10.96
33.78
8.68
35.71
9.54
37.5
样例输入2
输出xi,yi及各阶均差
Xi f(xi)
0.1000000000 6.5400000000
4.7600000000 5.1900000000 -0.2896995708
6.6500000000 4.5300000000 -0.3492063492 -0.0090850043
9.5100000000 4.9900000000 0.1608391608 0.1073780021 0.0123765150
12.1700000000 2.2100000000 -1.0451127820 -0.2184695549 -0.0439740293 -0.0046686449
15.2300000000 6.8100000000 1.5032679739 0.4455211112 0.0773881895 0.0115914249 0.0010746907
17.3500000000 6.1000000000 -0.3349056604 -0.3548597749 -0.1020893987 -0.0167736064 -0.0022529810 -0.0001929085
19.2100000000 8.8900000000 1.5000000000 0.4610315730 0.1158936574 0.0224724800 0.0031246884 0.0003721571 0.0000295691
22.1500000000 4.8800000000 -1.3639455782 -0.5966553288 -0.1528449280 -0.0269277140 -0.0039082432 -0.0004537375 -0.0000474925 -0.0000034949
23.4600000000 3.7200000000 -0.8854961832 0.1125763282 0.1160771943 0.0326758350 0.0052793223 0.0006586068 0.0000661716 0.0000060783 0.0000004098
27.1100000000 3.2100000000 -0.1397260274 0.1503568863 0.0047823491 -0.0114031604 -0.0037103531 -0.0006017186 -0.0000716094 -0.0000067342 -0.0000005733 -0.0000000364
28.8100000000 2.7800000000 -0.2529411765 -0.0211617101 -0.0257535430 -0.0031808221 0.0007174815 0.0003260556 0.0000557557 0.0000065992 0.0000006017 0.0000000489 0.0000000030
29.8700000000 3.5800000000 0.7547169811 0.3650935354 0.0602582286 0.0111414212 0.0013435500 0.0000500055 -0.0000188559 -0.0000042153 -0.0000005312 -0.0000000488 -0.0000000039 -0.0000000002
30.5200000000 2.2800000000 -2.0000000000 -1.6109456030 -0.5794836183 -0.0906149925 -0.0121572776 -0.0011937071 -0.0000944353 -0.0000049431 -0.0000000397 0.0000000234 0.0000000030 0.0000000003 0.0000000000
30.9900000000 2.1100000000 -0.3617021277 1.4627659574 1.4099594314 0.5127430540 0.0801272306 0.0104394240 0.0009875324 0.0000793231 0.0000053468 0.0000002862 0.0000000122 0.0000000004 0.0000000000 -0.0000000000
32.0100000000 2.4700000000 0.3529411765 0.4796263786 -0.4594110181 -0.5841782655 -0.2238614938 -0.0355542368 -0.0046646715 -0.0004415784 -0.0000355322 -0.0000024362 -0.0000001372 -0.0000000066 -0.0000000003 -0.0000000000 -0.0000000000
33.8500000000 2.2600000000 -0.1141304348 -0.1633117522 -0.1930745138 0.0669187197 0.1291859098 0.0523809204 0.0084634415 0.0011220609 0.0001068060 0.0000086266 0.0000005941 0.0000000337 0.0000000017 0.0000000001 0.0000000000 0.0000000000
34.9100000000 1.5500000000 -0.6698113208 -0.1916140986 -0.0072199863 0.0423358832 -0.0048775469 -0.0219776158 -0.0095331457 -0.0015717543 -0.0002111140 -0.0000202497 -0.0000016444 -0.0000001137 -0.0000000065 -0.0000000003 -0.0000000000 -0.0000000000 -0.0000000000
37.5000000000 6.0000000000 1.7181467181 0.6542350792 0.1540708885 0.0247758640 -0.0025157621 0.0003095393 0.0025646899 0.0011643730 0.0001948809 0.0000264492 0.0000025532 0.0000002083 0.0000000145 0.0000000008 0.0000000000 0.0000000000 0.0000000000 0.0000000000
输出牛顿插值表达式
F19(x)=
6.5400000000
+ -0.2896995708(x-0.10)
+ -0.0090850043(x-0.10)(x-4.76)
+ 0.0123765150(x-0.10)(x-4.76)(x-6.65)
+ -0.0046686449(x-0.10)(x-4.76)(x-6.65)(x-9.51)
+ 0.0010746907(x-0.10)(x-4.76)(x-6.65)(x-9.51)(x-12.17)
+ -0.0001929085(x-0.10)(x-4.76)(x-6.65)(x-9.51)(x-12.17)(x-15.23)
+ 0.0000295691(x-0.10)(x-4.76)(x-6.65)(x-9.51)(x-12.17)(x-15.23)(x-17.35)
+ -0.0000034949(x-0.10)(x-4.76)(x-6.65)(x-9.51)(x-12.17)(x-15.23)(x-17.35)(x-19.21)
+ 0.0000004098(x-0.10)(x-4.76)(x-6.65)(x-9.51)(x-12.17)(x-15.23)(x-17.35)(x-19.21)(x-22.15)
+ -0.0000000364(x-0.10)(x-4.76)(x-6.65)(x-9.51)(x-12.17)(x-15.23)(x-17.35)(x-19.21)(x-22.15)(x-23.46)
+ 0.0000000030(x-0.10)(x-4.76)(x-6.65)(x-9.51)(x-12.17)(x-15.23)(x-17.35)(x-19.21)(x-22.15)(x-23.46)(x-27.11)
+ -0.0000000002(x-0.10)(x-4.76)(x-6.65)(x-9.51)(x-12.17)(x-15.23)(x-17.35)(x-19.21)(x-22.15)(x-23.46)(x-27.11)(x-28.81)
+ 0.0000000000(x-0.10)(x-4.76)(x-6.65)(x-9.51)(x-12.17)(x-15.23)(x-17.35)(x-19.21)(x-22.15)(x-23.46)(x-27.11)(x-28.81)(x-29.87)
+ -0.0000000000(x-0.10)(x-4.76)(x-6.65)(x-9.51)(x-12.17)(x-15.23)(x-17.35)(x-19.21)(x-22.15)(x-23.46)(x-27.11)(x-28.81)(x-29.87)(x-30.52)
+ -0.0000000000(x-0.10)(x-4.76)(x-6.65)(x-9.51)(x-12.17)(x-15.23)(x-17.35)(x-19.21)(x-22.15)(x-23.46)(x-27.11)(x-28.81)(x-29.87)(x-30.52)(x-30.99)
+ 0.0000000000(x-0.10)(x-4.76)(x-6.65)(x-9.51)(x-12.17)(x-15.23)(x-17.35)(x-19.21)(x-22.15)(x-23.46)(x-27.11)(x-28.81)(x-29.87)(x-30.52)(x-30.99)(x-32.01)
+ -0.0000000000(x-0.10)(x-4.76)(x-6.65)(x-9.51)(x-12.17)(x-15.23)(x-17.35)(x-19.21)(x-22.15)(x-23.46)(x-27.11)(x-28.81)(x-29.87)(x-30.52)(x-30.99)(x-32.01)(x-33.85)
+ 0.0000000000(x-0.10)(x-4.76)(x-6.65)(x-9.51)(x-12.17)(x-15.23)(x-17.35)(x-19.21)(x-22.15)(x-23.46)(x-27.11)(x-28.81)(x-29.87)(x-30.52)(x-30.99)(x-32.01)(x-33.85)(x-34.91)
样例输出一
输出xi,yi及各阶均差
Xi f(xi)
1.70 19.89
4.80 24.52 1.49
5.98 34.82 8.73 1.69
8.83 40.54 2.01 -1.67 -0.47
12.18 37.67 -0.86 -0.46 0.16 0.06
15.21 41.38 1.22 0.33 0.09 -0.01 -0.01
17.92 30.00 -4.20 -0.94 -0.14 -0.02 -0.00 0.00
19.50 19.68 -6.53 -0.54 0.05 0.02 0.00 0.00 -0.00
22.23 14.56 -1.88 1.08 0.23 0.02 -0.00 -0.00 -0.00 -0.00
24.56 18.86 1.85 0.74 -0.05 -0.03 -0.00 -0.00 -0.00 0.00 0.00
27.31 17.98 -0.32 -0.43 -0.15 -0.01 0.00 0.00 0.00 0.00 0.00 -0.00
29.11 21.62 2.02 0.51 0.14 0.03 0.00 0.00 -0.00 -0.00 -0.00 -0.00 -0.00
29.87 17.98 -4.79 -2.66 -0.60 -0.10 -0.01 -0.00 -0.00 -0.00 -0.00 0.00 0.00 0.00
30.87 14.86 -3.12 0.95 1.01 0.26 0.04 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
31.51 12.86 -3.12 -0.00 -0.40 -0.34 -0.09 -0.01 -0.00 -0.00 -0.00 -0.00 -0.00 -0.00 -0.00 -0.00
32.89 10.96 -1.38 0.87 0.29 0.18 0.09 0.02 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
33.78 8.68 -2.56 -0.52 -0.48 -0.20 -0.08 -0.03 -0.01 -0.00 -0.00 -0.00 -0.00 -0.00 -0.00 -0.00 -0.00 -0.00
35.71 9.54 0.45 1.07 0.38 0.18 0.06 0.02 0.01 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
37.50 6.00 -1.98 -0.65 -0.37 -0.13 -0.05 -0.01 -0.00 -0.00 -0.00 -0.00 -0.00 -0.00 -0.00 -0.00 -0.00 -0.00 -0.00 -0.00
输出牛顿插值表达式
F19(x)=
19.89
+ 1.49(x-1.70)
+ 1.69(x-1.70)(x-4.80)
+ -0.47(x-1.70)(x-4.80)(x-5.98)
+ 0.06(x-1.70)(x-4.80)(x-5.98)(x-8.83)
+ -0.01(x-1.70)(x-4.80)(x-5.98)(x-8.83)(x-12.18)
+ 0.00(x-1.70)(x-4.80)(x-5.98)(x-8.83)(x-12.18)(x-15.21)
+ -0.00(x-1.70)(x-4.80)(x-5.98)(x-8.83)(x-12.18)(x-15.21)(x-17.92)
+ -0.00(x-1.70)(x-4.80)(x-5.98)(x-8.83)(x-12.18)(x-15.21)(x-17.92)(x-19.50)
+ 0.00(x-1.70)(x-4.80)(x-5.98)(x-8.83)(x-12.18)(x-15.21)(x-17.92)(x-19.50)(x-22.23)
+ -0.00(x-1.70)(x-4.80)(x-5.98)(x-8.83)(x-12.18)(x-15.21)(x-17.92)(x-19.50)(x-22.23)(x-24.56)
+ -0.00(x-1.70)(x-4.80)(x-5.98)(x-8.83)(x-12.18)(x-15.21)(x-17.92)(x-19.50)(x-22.23)(x-24.56)(x-27.31)
+ 0.00(x-1.70)(x-4.80)(x-5.98)(x-8.83)(x-12.18)(x-15.21)(x-17.92)(x-19.50)(x-22.23)(x-24.56)(x-27.31)(x-29.11)
+ 0.00(x-1.70)(x-4.80)(x-5.98)(x-8.83)(x-12.18)(x-15.21)(x-17.92)(x-19.50)(x-22.23)(x-24.56)(x-27.31)(x-29.11)(x-29.87)
+ -0.00(x-1.70)(x-4.80)(x-5.98)(x-8.83)(x-12.18)(x-15.21)(x-17.92)(x-19.50)(x-22.23)(x-24.56)(x-27.31)(x-29.11)(x-29.87)(x-30.87)
+ 0.00(x-1.70)(x-4.80)(x-5.98)(x-8.83)(x-12.18)(x-15.21)(x-17.92)(x-19.50)(x-22.23)(x-24.56)(x-27.31)(x-29.11)(x-29.87)(x-30.87)(x-31.51)
+ -0.00(x-1.70)(x-4.80)(x-5.98)(x-8.83)(x-12.18)(x-15.21)(x-17.92)(x-19.50)(x-22.23)(x-24.56)(x-27.31)(x-29.11)(x-29.87)(x-30.87)(x-31.51)(x-32.89)
+ 0.00(x-1.70)(x-4.80)(x-5.98)(x-8.83)(x-12.18)(x-15.21)(x-17.92)(x-19.50)(x-22.23)(x-24.56)(x-27.31)(x-29.11)(x-29.87)(x-30.87)(x-31.51)(x-32.89)(x-33.78)
+ -0.00(x-1.70)(x-4.80)(x-5.98)(x-8.83)(x-12.18)(x-15.21)(x-17.92)(x-19.50)(x-22.23)(x-24.56)(x-27.31)(x-29.11)(x-29.87)(x-30.87)(x-31.51)(x-32.89)(x-33.78)(x-35.71)
样例输出二
风景区的面积及道路状况分析问题 test的更多相关文章
- Wifiner for Mac(WiFi 状况分析工具)破解版安装
1.软件简介 Wifiner 是 macOS 系统上一款 Wifi 分析工具,仅需几次点击即可对您的 Wi-Fi 网络连接进行分析和故障排除.扫描您的 Wi-Fi 网络,获取包含交互式彩色编码热 ...
- JVM内存状况查看方法和分析工具
Java本身提供了多种丰富的方法和工具来帮助开发人员查看和分析GC及JVM内存的状况,同时开源界和商业界也有一些工具可用于查看.分析GC及JVM内存的状况.通过这些分析,可以排查程序中内存泄露的问题及 ...
- BI案例:某公司BI系统的九大主题分析
1.KPI分析 KPI分析按照管理层次和时间纬度对指标进行汇总统计及分析展示,以适应各级领导的管理需求.在某公司,KPI不仅只是一个数据展示,而且已经成为一个内部考核指标的监控平台.各级领导每天上班的 ...
- Area - POJ 1265(pick定理求格点数+求多边形面积)
题目大意:以原点为起点然后每次增加一个x,y的值,求出来最后在多边形边上的点有多少个,内部的点有多少个,多边形的面积是多少. 分析: 1.以格子点为顶点的线段,覆盖的点的个数为GCD(dx,dy),其 ...
- DRDS SQL 审计与分析——全面洞察 SQL 之利器
背景 数据库存储着系统的核心数据,其安全方面的问题在传统环境中已经成为泄漏和被篡改的重要根源.而在云端,数据库所面临的威胁被进一步的放大.因此,对云数据库的操作行为尤其是全量 SQL 执行记录的审计日 ...
- 5290: [Hnoi2018]道路
5290: [Hnoi2018]道路 链接 分析: 注意题目中说每个城市翻新一条连向它的公路或者铁路,所以两种情况分别转移一下即可. 注意压一下空间,最后的叶子节点不要要访问,空间少了一半. 代码: ...
- Python大数据:信用卡逾期分析
# -*- coding:utf-8 -*- # 数据集成 import csv import numpy as np import pandas as pd import matplotlib.py ...
- 使用python抓取并分析数据—链家网(requests+BeautifulSoup)(转)
本篇文章是使用python抓取数据的第一篇,使用requests+BeautifulSoup的方法对页面进行抓取和数据提取.通过使用requests库对链家网二手房列表页进行抓取,通过Beautifu ...
- hdu 1542&&poj 1151 Atlantis[线段树+扫描线求矩形面积的并]
Atlantis Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total S ...
随机推荐
- 查询删除安装rpm -qa | grep -i wrapname
查询:rpm -qa | grep -i wrapname 删除:sudo rpm -ev wrapname 删除依赖:sudo rpm -ev --nodeps mysql-libs-5.6.60- ...
- Why String is Immutable or Final in Java
The string is Immutable in Java because String objects are cached in String pool. Since cached Strin ...
- qt——QT中QWidget、QDialog及QMainWindow的区别
QWidget类是所有用户界面对象的基类. 窗口部件是用户界面的一个基本单元:它从窗口系统接收鼠标.键盘和其它事件,并且在屏幕上绘制自己.每一个窗口部件都是矩形的,并且它们按Z轴顺序排列.一个窗口部件 ...
- sqlserver 索引的结构及其存储,索引内容
sqlserver 索引的结构及其存储,sql server索引内容 文章转载,原文地址: http://www.cnblogs.com/panchunting/p/SQLServer_IndexSt ...
- 学习Spark2.0中的Structured Streaming(一)
转载自:http://lxw1234.com/archives/2016/10/772.htm Spark2.0新增了Structured Streaming,它是基于SparkSQL构建的可扩展和容 ...
- IP设置-内置服务器-外置服务器
HBulider 中 运行 -> 设置web服务器 -> 内置服务器将 127.0.0.1 换为局域网的ip,可以在局域网内所有电脑,手机上浏览页面.但是只能浏览html,php asp等 ...
- type Props={};
Components Learn how to type React class components and stateless functional components with Flow Se ...
- linux 加减符号
[root@LocalWeb01 ~]# aa=11[root@LocalWeb01 ~]# bb=22[root@LocalWeb01 ~]# cc=$aa+$bb[root@LocalWeb01 ...
- mysql的Navicat查看数据库的ER图
1.mysql数据库表间的关系图可以通过navicat查看.
- Keepalived 安装
Keepalived 安装安装环境 keepalived-1.2.18.tar.gz VM虚拟机redhat6.5-x64:192.168.1.201 Xshell4 部署方案 201部署 安装步骤 ...