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

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. pcre函数具体解释

    PCRE是一个NFA正则引擎,不然不能提供全然与Perl一致的正则语法功能.但它同一时候也实现了DFA,仅仅是满足数学意义上的正则. PCRE提供了19个接口函数,为了简介,使用PCRE内带的測试程序 ...

  2. 拿别人APP的IPA包及你看上的图片

    闲话不多说, 开工 在MacX下载Itools软件,并安装,直接在百度上搜也能找到.Itools挺强大的,我在这里推荐一下. 在Itools中点击资源库,如果你连接上你的iPhone,这个按钮就在右上 ...

  3. Unity UGUI在鼠标位置不同时 图片浮动效果

    /// <summary> /// 在鼠标位置不同时 图片浮动效果 /// </summary> public class TiltWindow : MonoBehaviour ...

  4. CSS样式的优先机制

    链接:http://www.cnblogs.com/xugang/archive/2010/09/24/1833760.html 又抓到虫子了:IE中奇怪的应用CSS的BUG:http://www.c ...

  5. MFC模式对话框与非模式对话框 消息处理顺序

    对话框有两种创建方式:DoModal和Creat. 其中DoModal创建的是模态的对话框,而Creat创建的是非模态的对话框下面总结下他们的不同. 对于模态的对话框,在该对话框被关闭前,用户将不能在 ...

  6. HDU 1240 Asteroids!

    三维广搜 #include <cstdio> #include <iostream> #include <cstring> #include <queue&g ...

  7. Github 初识(上传、下载)

    Git - 版本控制工具Github - 一个网站,提供给用户空间创建git仓储,保存用户的一些数据文档或者代码等GitLab - 基于Git的项目管理软件   上传 1 首先在Github 上注册一 ...

  8. 工程中.pch文件的作用 及使用方法

    #ifdef __OBJC__ #define ABC 10#import "UIImage+Image.h"// 配置pch: buildSetting -> prefix ...

  9. invalid nib registered for identifier (重用符) - nib must contain exactly one top level object which must be a UITableViewCell instance'

    通过xib创建cell的时候 一定要注意!!! 这个错误是在这个xib中在View同一层级出现了其他的控件,检查一下xib中左边的层级关系,让cell的view是唯一的控件就可以了,否则一执行 就会提 ...

  10. Tree(未解决。。。)

    Tree Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submi ...