题目链接:hdu_5826_physics

题意:

给你一些点的速度和初始位置,还有方向,这些速度和加速度满足v*a=c,然后又q个询问,问第t秒第K小的速度是多少

题解:

将物理公式转换为v与t的关系,然后将初始的v排序后直接输出就行

公式为v=sqrt(2*c*t+v02)

 #include <cstdio>
#include <algorithm>
#include <cmath>
using namespace std;
const int N = 1e5 +;
double v[N];
int main()
{
int t;
scanf("%d", &t);
while (t--)
{
int n, c, x, d, q;
scanf("%d%d", &n, &c);
for (int i = ; i <= n; i++) scanf("%lf%d%d", &v[i], &x, &d);
sort(v + , v + + n);
scanf("%d", &q);
for (int i = ; i <= q; i++)
{
scanf("%d%d", &x, &d);
printf("%.3f\n", sqrt(2.0 * c * x + v[d] * v[d]));
}
}
return ;
}

hdu_5826_physics(物理题)的更多相关文章

  1. Codeforces Round #114 (Div. 1) A. Wizards and Trolleybuses 物理题

    A. Wizards and Trolleybuses Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/conte ...

  2. HDOJ 1330 Deck(叠木块-物理题啊!贪心算法用到了一点)

    Problem Description A single playing card can be placed on a table, carefully, so that the short edg ...

  3. hdu 5761 Rower Bo 物理题

    Rower Bo 题目连接: http://acm.hdu.edu.cn/showproblem.php?pid=5761 Description There is a river on the Ca ...

  4. hdu 5066 小球碰撞(物理题)

    http://acm.hdu.edu.cn/showproblem.php?pid=5066 中学物理题 #include <cstdio> #include <cstdlib> ...

  5. hdoj 4445 Crazy Tank 物理题/枚举角度1

    Crazy TankTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total S ...

  6. Bungee Jumping---hdu1155(物理题)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1155 题目很长,但是很容易理解,就是人从高s的桥上跳下来,手拉着长为l的绳子末端,如果绳子太短那么人将 ...

  7. [物理题+枚举] hdu 4445 Crazy Tank

    题意: 给你N个炮弹的发射速度,以及炮台高度H和L1,R1,L2,R2. 问任选发射角度.最多能有几个炮弹在不打入L2~R2的情况下打入L1~R1 注意:区间有可能重叠. 思路: 物理题,发现单纯的依 ...

  8. HDU 1155 Bungee Jumping(物理题,动能公式,弹性势能公式,重力势能公式)

    传送门: Bungee Jumping Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Othe ...

  9. 杭电 1155 Bungee Jumping(物理题)

    Problem Description Once again, James Bond is fleeing from some evil people who want to see him dead ...

随机推荐

  1. (89C51)定时器计时1s

    unsigned ; void initT1() { EA=; TH1=0xDC; TL1=0X00; TMOD=0x10; TR1=; ET1=; } { TH1=0xDC; TL1=0X00; c ...

  2. java-读取属性文件

    Property类: public static Properties loadLocalProperties(String fileName) { Properties property = new ...

  3. 深入理解Hadoop集群和网络

    导读:云计算和Hadoop中网络是讨论得相对比较少的领域.本文原文由Dell企业技术专家Brad Hedlund撰写,他曾在思科工作多年,专长是数据中心.云网络等.文章素材基于作者自己的研究.实验和C ...

  4. CentOS+OpenCV图像的读入、显示

    以管理员身份运行su root输入密码 定位到自己的桌面目录 gedit 1.cpp 编辑内容 #include<opencv2/opencv.hpp>using namespace cv ...

  5. python 内嵌函数, 闭包, 函数装饰器

    一.  函数内嵌 闭包 在python中,函数可以作为返回值, 可以给变量赋值. 在python中, 内置函数必须被显示的调用, 否则不会执行. #!/usr/bin/env python #-*- ...

  6. iOS Plugins

    iOS Plugins This section provides details for how to implement native plugin code on the iOS platfor ...

  7. ios7 实现应用内保真截屏

    CGSize size = self.content.bounds.size; UIGraphicsBeginImageContextWithOptions(size, NO, [UIScreen m ...

  8. 前端好的工具集推荐 lodash

    原来用 backbone 的时候, 感觉 underscore 是一个好的工具集,顿时感觉不错,不用自己一直去封装一些组件. 直到我遇到了 lodash,一只发现 web 项目中有依赖这个库的,但是一 ...

  9. SQLServer性能优化

    http://www.cnblogs.com/studyzy/archive/2008/11/24/1339772.html

  10. sqlserver跨数据库与跨服务器使用

    sqlserver跨数据库与跨服务器使用 日常数据库编程中经常会遇到需要跨数据库和跨服务器的情况,本文总结解决方法,具体如下: 工具/原料 SQLSERVER 数据库 方法/步骤   跨数据库使用比较 ...