URAL 1192. Ball in a Dream

水题一枚~~之前一直没怎么看懂题,事实证明。。。我想歪了。。。

开始一直没明白过来pi干吗用 = =。。直到样例过不去才发现了,输入是角度。。计算用的是弧度。。笨。。

给你速度和初始角度,每次落地减少为原来1/K的动能,求能跳到的最大距离。。

纯物理题。。


#include <set>
#include <map>
#include <queue>
#include <stack>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <limits.h>
#include <string.h>
#include <string>
#include <algorithm>
#define MID(x,y) ( ( x + y ) >> 1 )
#define L(x) ( x << 1 )
#define R(x) ( x << 1 | 1 )
#define FOR(i,s,t) for(int i=(s); i<(t); i++)
#define BUG puts("here!!!")
#define STOP system("pause")
#define file_r(x) freopen(x, "r", stdin)
#define file_w(x) freopen(x, "w", stdout)

using namespace std;

const double pi = acos(-1.0);
int main()
{
	double v, a, k;
	
	while( ~scanf("%lf%lf%lf", &v, &a, &k) )
	{
		double sum = 0;
		a = a*pi/180;
		while( v > 0.01 )//经测试,这个上界最大为0.01.。。。 
		{
			double vx = v*sin(a);
			double vy = v*cos(a);
			double t = vy / 10.0;
			sum += vx * t * 2;
			v /= sqrt(k);
		}
		
		printf("%.2lf\n", sum);
	}

return 0;
}


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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值