csu 1742 Integral Function(分区间求积分)
来源:互联网 发布:hbase删除一条数据 编辑:程序博客网 时间:2024/04/29 21:43
Integral Function
Time Limit: 1 Sec Memory Limit: 128 MBSubmit: 78 Solved: 26
[Submit][Status][Web Board]
Description
In mathematics, several function are unable to integral. For example:
But you can get the answer by computer.
Input
There are no more than T (T<=30) cases. Each case include two integer a, b (0<a <= b<=10).
Output
Each case output an answer.
(Please output the answer by ‘‘ printf (“%d\n”,(int)(answer*10000)) ‘‘ ).
Sample Input
1 11 22 8
Sample Output
06593-312
题意:求思路:这是个典型的不可积函数,然后观察发现a和b都比较小,那么我们分区间,把所有矩形加起来即可得到近似值
代码:
#include <iostream>#include <cstdio>#include <cstring>#include <algorithm>#include <cmath>using namespace std;int main(){ double a,b; while(~scanf("%lf %lf",&a,&b)) { if(a==b) { printf("0\n"); continue; } double ans=0.0,d=(b-a)/100000; while(a<=b) { ans=ans+sin(a)/a*d; a+=d; } printf("%d\n",(int)(ans*10000)); } return 0;}
0 0
- csu 1742 Integral Function(分区间求积分)
- 积分非线性(Integral nonlinearity,INL)
- 关于积分图(Integral Image)
- integral image(积分图) 和 boxfilter
- 积分图像(Integral Image)
- 积分图像(Integral Image)与积分直方图 (Integral Histogram)
- 积分图像(Integral Image)与积分直方图 (Integral Histogram)
- 积分通道特征(Integral Channel Features)(我写的(文章的部分内容))
- 积分通道特征(integral channel features)(大腿写的详细版)
- 积分通道特征(integral channel features)
- Opencv中integral计算积分图
- 积分直方图(Integral Histog…
- OpenCV积分图函数:integral ()介绍
- csu 1592 石子归并(区间DP)
- CSU 1592 石子归并(区间dp)
- CSU 1592:石子归并(区间DP)
- 自适应Simpson积分(近似求积分)
- 用卷积公式求概率密度时确定积分区间
- IPC机制---使用AIDL
- oracle带参数的游标
- 小胖说swift01--------如何在Swift开发中使用CocoaPods导入的第三方库
- cookie入门介绍
- Oracle启动服务命令以及数据库表基本操作增删改查
- csu 1742 Integral Function(分区间求积分)
- iOS Foundation 重要知识点
- LeetCode 205. Isomorphic Strings
- RAID磁盘阵列详解
- linux常用命令以及部分hit
- text——android.graphic.typeface字体类
- spring mvc实现Restful返回xml格式数据
- Fiddler界面详解
- 数据结构实验之栈四:括号匹配