第五届山东省ACM angry_birds_again_and_again(积分)

angry_birds_again_and_again

给定曲线,给定一个点,求从曲线上某点到x轴上某点直线恰为曲线切线和曲线围成的面积。

水题,求积分做就好了,但是开始还错了,回车竟然判成WR而不是PR,第一题就卡,醉了。。。

#include<cstdio>
#include<cstring>
#include<cmath>
#include<cstdlib>
#include<iostream>
#include<algorithm>
#include<vector>
#include<map>
#include<queue>
#include<stack>
#include<string>
#include<map>
#include<set>
#include<ctime>
#define eps 1e-6
#define MAX 100005
#define INF 0x3f3f3f3f
#define LL long long
#define pii pair<string,int>
#define rd(x) scanf("%d",&x)
#define rd2(x,y) scanf("%d%d",&x,&y)
using namespace std;
int main()
{
    double a,b,du;
    double  T,P;
    int xx,yy;
    int n;
    rd(n);
    while(n--)
    {
        rd2(xx,yy);
        T=yy,P=xx;
        scanf("%lf",&du);
        b=tan(du);
        a=b*P/(T*T-2*T*P);
        double y0=a*T*T+b*T;
        double area = 1/3.0*a*T*T*T+1/2.0*b*T*T  +   1/2.0*(P-T)*y0;
        //cout<<a<<' ' <<y0<<endl;
        printf("%.3f\n",area);
    }
    return 0;
}


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值