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;
}
题意:一个人开小船从(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;
}
相关文章推荐
- 网络编程UDP协议
- zabbix 3.0.3 邮件报警
- [iOS] 指定UIView的某几个角为圆角
- 使用Jquery解析Json基础知识
- 使用线程池实现异步打日志和存库的任务调度
- cmd 进入mysql
- org.springframework.orm.hibernate3.LocalSessionFactoryBean
- Linux硬链接与软链接
- 安装qtceator后无法启动help插件 Qt编译错误:cannot find -lGL 解决办法
- 浅析Android Application对象
- SDUT 3363 数据结构实验之图论七:驴友计划
- MySQL索引的查看创建和删除
- 书乐说:华谊兄弟失守电影市场?票房泡沫爆裂前的一场前戏
- 三角剖分算法
- 保存的设置用户ID
- HDU 1597 find the nth digit
- 视频摘要和视频浓缩的区别
- 今天再练习并查集——hdu 1213
- HDU 5723/2016多校1A Abandoned country
- NCR(Numeric Character Reference)简单介绍