hdu 5078
Osu!
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others)
Total Submission(s): 58 Accepted Submission(s): 41
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.5893762558鞍山现场赛第签到题,超级水!!
求最大难度,难度为相邻两点的距离除以时间差。#include <stdio.h>
#include <string.h>
#include <iostream>
#include <math.h>
#include <algorithm>
#include <vector>
#include <map>
#include <queue>
#include <stack>
#define PI acos(-1.0)
#define eps 1e-8
#define LL long long
#define moo 1000000007
#define INF -999999999
using namespace std;
long long a[1005],b[1005],c[1005];
double d[1005];
int main()
{
int t;
int n;
scanf("%d",&t);
while(t--)
{ scanf("%d",&n);
double ans=0;
for(int i=0;i<n;i++)
{
scanf("%I64d%I64d%I64d",&a[i],&b[i],&c[i]);
}
for(int i=1;i<n;i++)
{
d[i]=sqrt((b[i]-b[i-1])*(b[i]-b[i-1])+(c[i]-c[i-1])*(c[i]-c[i-1]))/(a[i]-a[i-1]);
ans=max(d[i],ans);
}
printf("%.10f\n",ans);
}
}
hdu 5078的更多相关文章
- 2014 Asia AnShan Regional Contest --- HDU 5078 Osu!
Osu! Problem's Link: http://acm.hdu.edu.cn/showproblem.php?pid=5078 Mean: 略. analyse: 签到题,直接扫一遍就得答 ...
- hdu 5078 Osu! (2014 acm 亚洲区域赛鞍山 I)
题目链接:http://acm.hdu.edu.cn/showproblem.php? pid=5078 Osu! Time Limit: 2000/1000 MS (Java/Others) ...
- hdu 5078 2014鞍山现场赛 水题
http://acm.hdu.edu.cn/showproblem.php?pid=5078 现场最水的一道题 连排序都不用,由于说了ti<ti+1 //#pragma comment(link ...
- HDU - 5078 水题
题意:最大困难=距离 / 相邻时间 #include<cstring> #include<cstdio> #include<cmath> #define ll do ...
- hdu 5078(2014鞍山现场赛 I题)
数据 表示每次到达某个位置的坐标和时间 计算出每对相邻点之间转移的速度(两点间距离距离/相隔时间) 输出最大值 Sample Input252 1 9//t x y3 7 25 9 06 6 37 6 ...
- [ACM] HDU 5078 Osu!
Osu! Problem Description Osu! is a very popular music game. Basically, it is a game about clicking. ...
- HDU 5078 Revenge of LIS II(dp LIS)
Problem Description In computer science, the longest increasing subsequence problem is to find a sub ...
- hdu 5078 Osu!(鞍山现场赛)
Osu! Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others) Total Sub ...
- 2014 ACM-ICPC Asia Anshan Regional Contest(Online Version)
题目I - Osu! - HDU 5078 题目分析:最水的一道题吧,求两点间的距离和时间差值的最大比值 #include<stdio.h> #include<math.h> ...
随机推荐
- PHP数组问题
转换为数组 对于任意 integer , float , string , boolean 和 resource 类型,如果将一个值转换为数组,将得到一个仅有一个元素的数组,其下标为 0,该元素即为此 ...
- name_search方法的使用
转自:http://blog.csdn.net/littlebo01/article/details/22075573 在many2one类型中,页面下拉时会首先触发name_search方法,参数这 ...
- MAC-Zsh安装与使用——终极Shell
前言:Zsh可配置性强,用户可以自定义配置,个性化强.Zsh tab补全更强大,该功能可以让我们节约很多时间.Zsh 还有代码高亮功能,使得代码更好看了,显得逼格更高.Zsh 还有很多强大的功能,这里 ...
- Python-PyQt4学习笔记
1.每个应用必须创建一个 QtGui.QApplication(sys.argv), 此时 QtGui.qApp 为此应用的实例 app = QtGui.QApplication(sys.argv) ...
- HTML5学习笔记1 HTML5 新元素
自1999年以后html4.0已经改变了很我,今天,在html4.01中的几个已经被废弃,这些元素在html5中已经被删除或重新定义. 为了更好地处理今天的互联网应用,html5添加了很多新元素及功能 ...
- 微信小程序挑一挑辅助
1.窗体 using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;usi ...
- WCF公开服务元数据方式
一般我们使用了scvutil命令自动生成了服务的客户端代理类: 例如:svcutil http://localhost:8000/?wsdl /o:FirstServiceClient.cs 命令中h ...
- 各种MQTT server功能比較
this page attempts to document the features that various MQTT servers (brokers) support. This is spe ...
- 点滴积累【C#】---对上传文件的路径进行加密,以免将路径暴露在浏览器上,避免一些安全隐患!
效果: 描述: 本事例是为解决在上传或下载文件时避免将路径暴露在外.在上传时将路径进行加密保存到DataTable或数据库中,在下载是再读取DataTable中加密数据进行解密下载. 代码: [前台代 ...
- MapReduce编程(七) 倒排索引构建
一.倒排索引简单介绍 倒排索引(英语:Inverted index),也常被称为反向索引.置入档案或反向档案,是一种索引方法,被用来存储在全文搜索下某个单词在一个文档或者一组文档中的存储位置的映射. ...