hdu 5078 Osu!(鞍山现场赛)
Osu!
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others)
Total Submission(s): 20 Accepted Submission(s): 15
Special Judge

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 ti at place (xi, yi), and you should click it exactly at ti at (xi, yi). 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 ti and ti+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.
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, ti(0 ≤ ti < ti+1 ≤ 106),
xi, and yi (0 ≤ xi, yi ≤ 106) as mentioned above.
Your answer will be considered correct if and only if its absolute or relative error is less than 1e-9.
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
9.2195444573
54.5893762558HintIn memory of the best osu! player ever Cookiezi.
求最大难度,难度为相邻两点的距离除以时间差。
代码:
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <math.h>
using namespace std;
double a[10000];
double b[10000];
int ti[10000];
double dis(int i,int j)
{
return sqrt((a[i]-a[j])*(a[i]-a[j])+(b[i]-b[j])*(b[i]-b[j]));
}
int main()
{
int t,n;
scanf("%d",&t);
while(t--)
{
scanf("%d",&n);
double ans=0; for(int i=0;i<n;i++)
{
scanf("%d%lf%lf",&ti[i],&a[i],&b[i]);
}
for(int i=1;i<n;i++)
{
ans=max(ans,(dis(i-1,i)/(ti[i]-ti[i-1])));
}
printf("%.10f\n",ans);
}
return 0;
}
hdu 5078 Osu!(鞍山现场赛)的更多相关文章
- hdu 5078 2014鞍山现场赛 水题
http://acm.hdu.edu.cn/showproblem.php?pid=5078 现场最水的一道题 连排序都不用,由于说了ti<ti+1 //#pragma comment(link ...
- hdu 5078(2014鞍山现场赛 I题)
数据 表示每次到达某个位置的坐标和时间 计算出每对相邻点之间转移的速度(两点间距离距离/相隔时间) 输出最大值 Sample Input252 1 9//t x y3 7 25 9 06 6 37 6 ...
- hdu 5071(2014鞍山现场赛B题,大模拟)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5071 思路:模拟题,没啥可说的,移动的时候需要注意top的变化. #include <iostr ...
- 2014 acm鞍山现场赛总结
好像大家都习惯打完比赛写总结,我也来水一发好了.. 记一下流水账,那么多第一次献给了acm,不记一下就白去那么远的地方了.. 首先比赛前网上买了机票跟火车票了.比赛前一天早上6点钟起来收拾东西6点半坐 ...
- hdu 5078 Osu! (2014 acm 亚洲区域赛鞍山 I)
题目链接:http://acm.hdu.edu.cn/showproblem.php? pid=5078 Osu! Time Limit: 2000/1000 MS (Java/Others) ...
- 2014 Asia AnShan Regional Contest --- HDU 5078 Osu!
Osu! Problem's Link: http://acm.hdu.edu.cn/showproblem.php?pid=5078 Mean: 略. analyse: 签到题,直接扫一遍就得答 ...
- ACM/ICPM2014鞍山现场赛D Galaxy (HDU 5073)
题目链接:pid=5073">http://acm.hdu.edu.cn/showproblem.php?pid=5073 题意:给定一条线上的点,然后能够去掉当中的m个,使剩下的到重 ...
- hdu 5073 Galaxy(2014 鞍山现场赛)
Galaxy Time Limit: 2000/1000 MS (J ...
- ACM/ICPC2014鞍山现场赛E hdu5074Hatsune Miku
题目链接:pid=5074">http://acm.hdu.edu.cn/showproblem.php?pid=5074 题意: 给定一个m*m的矩阵mp.然后给定一个长度为n的序列 ...
随机推荐
- Zabbix + Grafana
Grafana 简介 Grafana自身并不存储数据,数据从其它地方获取.需要配置数据源 Grafana支持从Zabbix中获取数据 Grafana优化了图形的展现,可以用来做监控大屏 Grafana ...
- POJ 2457 BFS
题意: 说人话: 从A到B连边 找从1到k的最短路 并输出路径(随便一条即可 ) 如果不能到达 输出-1 思路: 搜 //By SiriusRen #include <queue> #in ...
- Linux集群的I/O性能测试
Linux集群的I/O性能测试 本文介绍利用iozone的性能测试工具,来测试集群性能.测试步骤如下:1.在Server节点上安装iozone(可以到www.iozone.org上下载) #rpm ...
- C/C++(指针数组)
指针数组 指针数组的本质是数组,数组指针的本质是指针 一个数组中的各个元素都是字符指针,即为字符指针数组,或者指针数组. int arr[] = {1,2,23,45,6};//整形数组 char c ...
- 12、UVC&V4L2的关系
UVC是一种usb视频设备驱动.用来支持usb视频设备,凡是usb接口的摄像头都能够支持 V4L2是Linux下的视频采集框架.用来统一接口,向应用层提供API UVC: USB video clas ...
- aop 中joinpoint的使用方法
一.簡述下joinpoint在不同情況下的不同: 1.在around中可以用,此時可以執行被包裹的代碼,可以根據情況來判斷是否執行被包裹的代碼,以實現控制的作用. public void around ...
- Oracle 10g 10.2.0.1 在Oracle Linux 5.4 32Bit RAC安装手冊(一抹曦阳)
Oracle 10g 10.2.0.1 在Oracle Linux 5.4 32Bit RAC安装手冊(一抹曦阳).pdf下载地址 ,step by step http://download.csdn ...
- actionBar-进入界面闪烁问题解决
问题分析: 主要是因为在开启一个应用的时候,当前界面并不是第一界面,在它之前,还有一个界面启动了,这个界面的唯一目的就是启动主界面,它目的不是显示.虽然如此,但是呢,这个界面的theme因为没有做统一 ...
- 逐步配置企业版Symantec Norton防病毒服务器
逐步配置企业版Symantec Norton防病毒服务器 配置企业版Symantec Norton NT操作系统,已经安装IIS 安装Symantec Norton 10 安装系统中心 650) th ...
- 洛谷 P2026 求一次函数解析式
P2026 求一次函数解析式 题目背景 做数学寒假作业的怨念…… 题目描述 给定两个整点的坐标,求它们所在直线的函数解析式(一次函数). 输入输出格式 输入格式: 输入共两行. 第一行有两个整数x1, ...