UVa 10773 - Back to Intermediate Math
题目:渡河问题。给你河水宽度,水流速度,求垂直渡河与最快渡河的时间差。
分析:物理题,数学题。
最快渡河情况,传垂直运动,垂直渡河,船的水平分速度和水流速度抵消。
说明:注意水流速度不能为0。
#include <cstdio>
#include <cmath> int main()
{
int T;
scanf("%d",&T);
for (int t = 1 ; t <= T ; ++ t) {
double d,v,u;
scanf("%lf%lf%lf",&d,&v,&u); printf("Case %d: ",t);
if (u > v && v)
printf("%.3lf\n",d/sqrt(u*u-v*v)-d/u);
else printf("can't determine\n");
}
return 0;
}
UVa 10773 - Back to Intermediate Math的更多相关文章
- How do I learn machine learning?
https://www.quora.com/How-do-I-learn-machine-learning-1?redirected_qid=6578644 How Can I Learn X? ...
- UVA 1397 - The Teacher's Side of Math(高斯消元)
UVA 1397 - The Teacher's Side of Math 题目链接 题意:给定一个x=a1/m+b1/n.求原方程组 思路:因为m*n最多20,全部最高项仅仅有20.然后能够把每一个 ...
- UVA 10400 Game Show Math (dfs + 记忆化搜索)
Problem H Game Show Math Input: standard input Output: standard output Time Limit: 15 seconds A game ...
- Math - Uva 11300 Spreading the Wealth
Spreading the Wealth Problem's Link ---------------------------------------------------------------- ...
- UVa 10400 - Game Show Math 游戏中的数学 dfs+判重
题意:给出一些数字和一个目标数字,要求你在数字间添加+-*/,让表达式能达到目标数字,运算符号的优先级都是一样的. 由于数据量很大,本来想用map<string>判重的,结果还是超时了,然 ...
- UVa 10400 - Game Show Math
题目大意:给出n(n<100)个正整数和一个目标数,按照给出数的顺序,运用+.-.*./四则运算(不考虑优先级),判断能否得出所要的结果. 首先考虑的就是暴力枚举,不过时间复杂度为O(4n),会 ...
- UVa 1595 Symmetry (set && math)
题意:给出n个在直角坐标系上的点,问你能不能找出一条竖轴(即垂直于x的轴)使得所有的点根据这条轴对称,能则输出YES,否则输出NO 分析:首先需要找到对称轴的值,将所有n个点的x轴的值加起来然后去除以 ...
- uva 11357 Matches
// uva 11357 Matches // // 题目大意: // // 给你n个火柴,用这n个火柴能表示的非负数有多少个,不能含有前导零 // // 解题思路: // // f[i] 表示正好用 ...
- UVa 10387- Billiard
UVa 10387- Billiard Table of Contents 1 题目 2 思路 3 代码 4 参考 1 题目 ============= Problem A: Billiard In ...
随机推荐
- Map容器之热血格斗场
3343:热血格斗场 总时间限制: 1000ms 内存限制: 65536kB 描述 为了迎接08年的奥运会,让大家更加了解各种格斗运动,facer新开了一家热血格斗场.格斗场实行会员制,但是新来的 ...
- KNN算法原理及实现
1.KNN算法概述 kNN算法的核心思想是如果一个样本在特征空间中的k个最相邻的样本中的大多数属于某一个类别,则该样本也属于这个类别,并具有这个类别上样本的特性.该方法在确定分类决策上只依据最邻近的一 ...
- php函数之数组
关联数组 isset bool isset( mixed $val [, mix $...]) 变量是否已设置并且非null.多个参数从左到右计算. 判断null $a=null;var_dump(i ...
- Java:获取文件内容
文章来源:https://www.cnblogs.com/hello-tl/p/9139353.html import java.io.*; public class FileBasicOperati ...
- 杭电 4004 The Frog's Games 青蛙跳水 (二分法,贪心)
Description The annual Games in frogs' kingdom started again. The most famous game is the Ironfrog T ...
- 【URAL 1486】Equal Squares(二维哈希+二分)
Description During a discussion of problems at the Petrozavodsk Training Camp, Vova and Sasha argued ...
- Web前端静态页面示例
目录结构: Web25\ |—css\ reset.css.common.css.index.css.login.css.reg.css |—js\ jquery-3.3.1.js.index.js. ...
- Leetcode 221.最大的正方形
最大的正方形 在一个由 0 和 1 组成的二维矩阵内,找到只包含 1 的最大正方形,并返回其面积. 示例: 输入: 1 0 1 0 0 1 0 1 1 1 1 1 1 1 1 1 0 0 1 0 输出 ...
- Linux vi替换字符串
1. 基本的替换 :s/vivian/sky/ 替换当前行第一个 vivian 为 sky :s/vivian/sky/g 替换当前行所有 vivian 为 sky :n,$s/vivian/sky/ ...
- B题 Sort the Array
题目大意:判断能否通过一次倒置,使序列变为一个递增序列 如果可以,输出倒置那一段的起始点和终点的位置: 题目链接:http://codeforces.com/problemset/problem/45 ...