hdu 5078 水题
来源:互联网 发布:谷歌浏览器java插件 编辑:程序博客网 时间:2024/06/07 02:01
http://acm.hdu.edu.cn/showproblem.php?pid=5078
时间排序,找距离/时间差最大点
#include <cstdio>#include <cstdlib>#include <cmath>#include <cstring>#include <string>#include <queue>#include <stack>#include <iostream>#include <algorithm>using namespace std;#define RD(x) scanf("%d",&x)#define RD2(x,y) scanf("%d%d",&x,&y)#define RD3(x,y,z) scanf("%d%d%d",&x,&y,&z)#define clr0(x) memset(x,0,sizeof(x))typedef long long LL;const int maxn = 1020;int n;struct node{ int t; double x,y;}p[maxn];bool cmp(node a,node b){ return a.t < b.t;}double dif(node a,node b){ return sqrt( (a.x - b.x)*(a.x - b.x) + (a.y-b.y)*(a.y-b.y) )/(double)(b.t-a.t);}int main() { int _;RD(_);while(_--){ RD(n); for(int i = 0;i < n;++i){ RD(p[i].t);scanf("%lf%lf",&p[i].x,&p[i].y); } sort(p,p+n,cmp); double ans = 0; for(int i = 1;i < n;++i){ ans = max(ans,dif(p[i-1],p[i])); } printf("%.10f\n",ans); } return 0;}
0 0
- hdu 5078 水题
- hdu 5078 Osu!(水题)
- HDU 5078--Osu!【水题】
- HDU 5078 Osu!(水题)
- hdu 5078
- hdu 5078
- hdu水题
- hdu 水题
- hdu 5078 2014鞍山现场赛 水题
- hdu 5078 Osu!
- [ACM] HDU 5078 Osu!
- HDU 5078 Osu!
- HDU 5078 Osu!
- HDU 5078 Osu!
- hdu 5078 Osu!
- hdu 5078 Osu!
- hdu 5078 Osu!(水)
- HDU 1800(水题!!! @@)
- $_GET['goods_id']+0
- 关于ACL
- 【自用模板】贪心
- Servlet 安装及应用
- Volley简介(一)
- hdu 5078 水题
- 常见的C语言笔试题
- strcpy和memcpy的区别与实现
- linux 输入长命令行时回到行首解决
- 年少轻狂,漫漫职业路
- aauto抓http数据
- java中,数据存储,以及堆和 栈
- qt 之 QScreen
- Linux下获取root权限的c程序