您的位置:首页 > 其它

HDU 5761 Rower Bo (数学题,积分)

2016-07-27 09:49 323 查看
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5761

题意:一个人开小船从(0, a)出发,水流速度一直沿x正方向为v2,小船本身速度方向一直朝原点,大小v1,问开到原点用时多少。

妈的数学题,积分,小船不过河去什么原点啊。

公式不会推,到现在也没弄明白。



#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
int main() {
int a, v1, v2;
while(~scanf("%d %d %d", &a, &v1, &v2)) {
if(a < 1) puts("0");
else if(v2 >= v1) puts("Infinity");
else printf("%lf\n", 1.0 * a * v1 / (v1 * v1 - v2 * v2));
}
return 0;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: