鞍山的签到题,求两点之间的距离除以时间的最大值。直接暴力过的。

A - Osu!

Time Limit:1000MS     Memory Limit:262144KB     64bit IO Format:%I64d & %I64u

Appoint description: 
System Crawler  (2014-10-22)

Description

Osu! is a very popular music game. Basically, it is a game about clicking. Some points will appear on the screen at some time, and you have to click them at a correct time.


Now, you want to write an algorithm to estimate how diffecult a game is.

To simplify the things, in a game consisting of N points, point i will occur at time t i at place (x i, y i), and you should click it exactly at t iat (x i, y i). That means you should move your cursor from point i to point i+1. This movement is called a jump, and the difficulty of a jump is just the distance between point i and point i+1 divided by the time between t i and t i+1. And the difficulty of a game is simply the difficulty of the most difficult jump in the game.

Now, given a description of a game, please calculate its difficulty.

 

Input

The first line contains an integer T (T ≤ 10), denoting the number of the test cases.

For each test case, the first line contains an integer N (2 ≤ N ≤ 1000) denoting the number of the points in the game.  Then N lines follow, the i-th line consisting of 3 space-separated integers, t i(0 ≤ t i < t i+1 ≤ 10 6), x i, and y i (0 ≤ x i, y i ≤ 10 6) as mentioned above.

 

Output

For each test case, output the answer in one line.

Your answer will be considered correct if and only if its absolute or relative error is less than 1e-9.

 

Sample Input

2
5
2 1 9
3 7 2
5 9 0
6 6 3
7 6 0
10
11 35 67
23 2 29
29 58 22
30 67 69
36 56 93
62 42 11
67 73 29
68 19 21
72 37 84
82 24 98
 

Sample Output

9.2195444573
54.5893762558

Hint

In memory of the best osu! player ever Cookiezi.
 #include<cstdio>
#include<algorithm>
#include<cmath>
#include<stdlib.h>
using namespace std;
const int maxn=+;
struct
{
double t;
double x;
double y
;
}Node[maxn];
int main()
{
int T;
scanf("%d",&T);
while(T--)
{
int N;
double maxd=-;
scanf("%d",&N);
for(int i=;i<N;i++)
scanf("%lf%lf%lf",&Node[i].t,&Node[i].x,&Node[i].y);
for(int i=;i<N;i++)
{
for(int j=i+;j<N;j++)
{
double time=sqrt((Node[i].x-Node[j].x)*(Node[i].x-Node[j].x)+(Node[i].y-Node[j].y)*(Node[i].y-Node[j].y))/fabs(Node[i].t-Node[j].t);
maxd=max(maxd,time);
}
}
printf("%.10lf\n",maxd);
}
return ;
}

2014ACM/ICPC亚洲区鞍山赛区现场赛1009Osu!的更多相关文章

  1. 2014ACM/ICPC亚洲区西安站现场赛 F color(二项式反演)

    题意:小球排成一排,从m种颜色中选取k种颜色给n个球上色,要求相邻的球的颜色不同,求可行的方案数,答案模1e9+7.T组数据,1<= n, m <= 1e9, 1 <= k < ...

  2. 2016 ACM/ICPC亚洲区青岛站现场赛(部分题解)

    摘要 本文主要列举并求解了2016 ACM/ICPC亚洲区青岛站现场赛的部分真题,着重介绍了各个题目的解题思路,结合详细的AC代码,意在熟悉青岛赛区的出题策略,以备战2018青岛站现场赛. HDU 5 ...

  3. 2013ACM/ICPC亚洲区南京站现场赛---Poor Warehouse Keeper(贪心)

    题目链接 http://acm.hdu.edu.cn/showproblem.php?pid=4803 Problem Description Jenny is a warehouse keeper. ...

  4. 2016ACM/ICPC亚洲区大连站现场赛题解报告(转)

    http://blog.csdn.net/queuelovestack/article/details/53055418 下午重现了一下大连赛区的比赛,感觉有点神奇,重现时居然改了现场赛的数据范围,原 ...

  5. 2014 ACM/ICPC 鞍山赛区现场赛 D&amp;I 解题报告

    鞍山现场赛结束了呢-- 我们出的是D+E+I三道题-- 吾辈AC掉的是D和I两道,趁着还记得.先在这里写一写我写的两道水题D&I的解题报告吧^_^. D题的意思呢是说星云内有一堆排成一条直线的 ...

  6. 2013ACM/ICPC亚洲区南京站现场赛-HDU4809(树形DP)

    为了这个题解第一次写东西..(我只是来膜拜爱看touhou的出题人的).. 首先以为对称性质..我们求出露琪诺的魔法值的期望就可以了..之后乘以3就是答案..(话说她那么笨..能算出来么..⑨⑨⑨⑨⑨ ...

  7. HDU 5073 Galaxy(2014鞍山赛区现场赛D题)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5073 解题报告:在一条直线上有n颗星星,一开始这n颗星星绕着重心转,现在我们可以把其中的任意k颗星星移 ...

  8. HDU 5074 Hatsune Miku(2014鞍山赛区现场赛E题)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5074 解题报告:给出一个长度为n的序列,例如a1,a2,a3,a4......an,然后这个序列的美丽 ...

  9. HDU 5071 Chat(2014鞍山赛区现场赛B题)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5071 解题报告:一个管理聊天窗口的程序,一共有八种操作,然后要注意的就是Top操作只是把编号为u的窗口 ...

随机推荐

  1. 超高性价比USB转CAN适配器,2500V工业级隔离,兼容ZLG软件

    淘宝链接: http://item.taobao.com/item.htm?spm=a230r.1.14.16.QGsAZg&id=20134109594&initiative_new ...

  2. 1.语言概述-JavaScript权威指南笔记

    上周三的时候交给老板目前的项目第一个迭代回顾会的总结.原本是以综述性的表述方式写的,交给他之后表示程序员不要长篇大论.总结要分为优点缺点期望等等块,每块列出条目,简明扼要的表达出来.这里也用这种风格. ...

  3. HTML技术简介

    1.DHTML:"Dynamic HTML"动态HTML技术的简称.DHTML并不是一项新技术,而是HTML,CSS,JavaScript技术组合的术语.DHTML背后的含义是: ...

  4. ##DAY7 UINavigationController

    ##DAY7 UINavigationController #pragma mark ———————UINavigationController——————————— 概括: 导航视图控制器也是一个视 ...

  5. tomcat 会话超时设置

    1.为单个WEB设置SESSION 在WEB.XML中添加 xml 代码 <session-config> <session-timeout>15</session-ti ...

  6. Android PNG渐变背景图片失真问题 getWindow().setFormat(PixelFormat.RGBA_8888);

    最近一个困扰很久的问题,渐变效果的png图片,设置为控件图片或background时,在eclipse上看着没有什么问题,但是在设备上运行时,可以看到明显的一圈圈的轮廓线,图片严重失真.在网上goog ...

  7. asp.net Page_Load事件加载两次

    Page_Load 即使加上 if(!IsPostBack){ ……} 还时走了2次 这时候 或者看看你的程序和脚本,是不是刷新页面了 或者页面的样式有错误的地方  例如: background:ur ...

  8. python下yield(生成器)

    python下的协程: #encoding=utf-8 """ 协程----微小的进程 yield生成器-----生成一个可迭代对象比如list, tuple,dir 1 ...

  9. js调用.net后台

    <head runat=server> <script type="text/javascript"> $(function () { var js_tim ...

  10. 玩转Bootstarp(连载)

    一.Bootstarp是什么? 简单.灵活的用于搭建WEB页面的HTML.CSS.JS的工具集 (基于HTML5和CSS3) 总结:简洁强大的前端开发框架,可以让WEB开发更迅速.更简单 二.如何使用 ...