HDU 5826 physics
该问题和xi,di均无关,碰撞只会使得速度反向,大小不会变。因此只要计算速度。

#pragma comment(linker, "/STACK:1024000000,1024000000")
#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<vector>
#include<map>
#include<set>
#include<queue>
#include<stack>
#include<iostream>
using namespace std;
typedef long long LL;
const double pi=acos(-1.0),eps=1e-;
void File()
{
freopen("D:\\in.txt","r",stdin);
freopen("D:\\out.txt","w",stdout);
}
inline int read()
{
char c = getchar(); while(!isdigit(c)) c = getchar(); int x = ;
while(isdigit(c)) { x = x * + c - ''; c = getchar(); }
return x;
} const int maxn=;
int T,n;
double C,v0[maxn]; int main()
{
scanf("%d",&T); while(T--)
{
scanf("%d%lf",&n,&C);
for(int i=;i<=n;i++)
{
scanf("%lf",&v0[i]);
int xi,di; scanf("%d%d",&xi,&di);
}
sort(v0+,v0+n+);
int q; scanf("%d",&q);
for(int i=;i<=q;i++)
{
int t,k; scanf("%d%d",&t,&k);
printf("%.3lf\n",sqrt(2.0*C*t+v0[k]*v0[k]));
}
}
return ;
}
HDU 5826 physics的更多相关文章
- HDU 5826 physics(物理)
physics(物理) Time Limit: 6000/3000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) D ...
- HDU 5826 physics (积分推导)
physics 题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5826 Description There are n balls on a smoo ...
- hdu 5826 physics 物理题
physics 题目连接: http://acm.hdu.edu.cn/showproblem.php?pid=5826 Description There are n balls on a smoo ...
- hdu 5826 physics (物理数学,积分)
physics Time Limit: 6000/3000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Sub ...
- hdu 5826 (物理) physics
题目:这里 题意:光滑的水平直线上有n个质量相等的小球,已知每个小球的初始位置,初始速度和方向,每个小球的每个时刻的加速度a都满足a*v=c,v是该时刻的速度,c是已知的 常数,小球之间的碰撞是完全碰 ...
- HDU 5572 An Easy Physics Problem (计算几何+对称点模板)
HDU 5572 An Easy Physics Problem (计算几何) 题目链接http://acm.hdu.edu.cn/showproblem.php?pid=5572 Descripti ...
- 【HDU 5572 An Easy Physics Problem】计算几何基础
2015上海区域赛现场赛第5题. 题目连接:http://acm.hdu.edu.cn/showproblem.php?pid=5572 题意:在平面上,已知圆(O, R),点B.A(均在圆外),向量 ...
- HDU 5572--An Easy Physics Problem(射线和圆的交点)
An Easy Physics Problem Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/ ...
- hdu 5572 An Easy Physics Problem 圆+直线
An Easy Physics Problem Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/ ...
随机推荐
- expri on the testdisk
首先,根据GNU的编译知识,来分析下载下来的目录,虽然里面有很多win的,andriod的文件,就不要管了,考入centos里面去, 按下面顺序执行就ok了. 第一步执行顺序: #autoscan ...
- mvc log4net将日志写入数据库失败解决之道——开启内部调试
项目信息:spring mvc5 EF6 数据库:sql2008r2 log4net版本:1.2.10.0 第一天: 1.思路一:配了半天,一直无法写入数据库,网上搜了一大堆的资料,都没能解决,怀疑 ...
- mysql bit类型数据库中无法显示
表an_bit bit类型字段id select bin(id+0) from an_bit显示二进制 select id+0 from an_bit显示十进制 http://blog.csdn.ne ...
- Codeforces Round #346 (Div. 2) C Tanya and Toys
C. Tanya and Toys 题目链接http://codeforces.com/contest/659/problem/C Description In Berland recently a ...
- Junit单元测试对线程测试没反应
今天还想简单写写线程的东西,结果刚刚写完我就懵逼了. 结果啥都没有输出,而用主方法运行就可以输出.没办法,只有度年来寻求自己的答案了 结果各方面的了解,我算是有个了解了. 首先来看看代码 packag ...
- FlatBuffers入门
1.下载flatbuffers 从https://github.com/google/flatbuffers地址下载flatbuffers-master.zip文件. 2.编译flatbuffers ...
- 表格单元格td设置宽度无效的解决办法 .
http://zzstudy.offcn.com/archives/11366 在做table页面时,有时对td设置的宽度是无效的,td的宽度始终有内部的内容撑开,可以设置padding,但直接设置w ...
- intellij idea 12 搭建maven web项目
原来公司一直使用eclipse,突然使用这个intellij还真有点不习惯,等用了一段时间才发现的确好用,因为也是刚开始用,所以很多不理解的地方,搭建一个项目从头好好了解下intellij 最开始的m ...
- MySQL5.5安装出现CMake错误找不到CMakelists.txt原因
今天虚拟机上测试安装 CentOS6.3 + PHP5.4.8 + MySQL5.5.28,结果捣鼓了半天 MySQL都没装上,老是CMake目录下找不到那个 lists 文件,郁闷的不行,最后发现问 ...
- IIS7或IIS7.5 ISAPI和CGI限制找不到的问题记录
弄了一下午,才找到,选择最上面的节点,如下图,记录备用