hdu 5144 NPY and shot 物理+三分】的更多相关文章

NPY and shot Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Problem Description NPY is going to have a PE test.One of the test subjects is throwing the shot.The height of NPY is H meters.He can throw the shot at t…
NPY and shot Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 1035    Accepted Submission(s): 428   Problem Description NPY is going to have a PE test.One of the test subjects is throwing the sh…
http://acm.hdu.edu.cn/showproblem.php?pid=5144 题意:给你初始的高度和速度,然后让你求出水平的最远距离. 思路:三分枚举角度,然后根据公式求出水平距离. #include <cstdio> #include <cstring> #include <cmath> #include <algorithm> using namespace std; const double pi=acos(-1.0); ; const…
当时做这道题时一直想退出物理公式来,但是后来推到导数那一部分,由于数学不好,没有推出来那个关于Θ的最值,后来直接暴力了,很明显超时了,忘了三分法的应用,这道题又是典型的三分求最值,是个单峰曲线,下面是代码 #include <stdio.h> #include <math.h> #define PI 3.1415926 int v, h; double f(double i)//推倒物理公式 { *i)/9.8+(sqrt(v*v*1.0*sin(i)*sin(i)+2.0*9.8…
NPY and shot Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 808    Accepted Submission(s): 342 Problem Description NPY is going to have a PE test.One of the test subjects is throwing the shot.T…
开始推导用公式求了好久(真的蠢),发现精度有点不够. 其实这种凸线上求点类的应该上三分法的,当作入门吧... /** @Date : 2017-09-23 21:15:57 * @FileName: HDU 5144 三分 无聊物理题.cpp * @Platform: Windows * @Author : Lweleth (SoungEarlf@gmail.com) * @Link : https://github.com/ * @Version : $Id$ */ #include <bit…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5144 题目意思:有个人抛物体,已知抛的速度和高度,问可以抛到的最远距离是多少.即水平距离. 做的时候是抄公式的,居然过了,幸运幸运............ #include <iostream> #include <cstdio> #include <cmath> #include <cstring> #include <algorithm> usi…
题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=5142 NPY and FFT Description A boy named NPY is learning FFT algorithm now.In that algorithm,he needs to do an operation called "reverse".For example,if the given number is 10.Its binary representai…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4717 说明下为啥满足三分: 设y=f(x) (x>0)表示任意两个点的距离随时间x的增长,距离y的变化.则f(x)函数单调性有两种:1.先单减,后单增.2.一直单增. 设y=m(x) (x>0)表示随时间x的增长,所有点的最大距离y的变化.即m(x)是所有点对构成的f(x)图像取最上面的部分.则m(x)的单调性也只有两种可能:1.先单减,后单增.2.一直单增. 这个地方的证明可以这样:假如时刻t1…
Shot Time Limit: 5000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1053    Accepted Submission(s): 590 Problem Description “超人”霍华德在NBA扣篮大赛上要求把篮筐升高表演扣篮,但是却没有得到批准,现在我们的hhb也想要给大家表演一个,但是这次他想要表演的是投篮,篮筐放得越高,hhb的表演当…