hdu 5078 2014鞍山现场赛 水题
2024-08-30 23:35:20
http://acm.hdu.edu.cn/showproblem.php?pid=5078
现场最水的一道题 连排序都不用,由于说了ti<ti+1
//#pragma comment(linker, "/STACK:102400000,102400000")
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <string>
#include <iostream>
#include <iomanip>
#include <cmath>
#include <map>
#include <set>
#include <queue>
using namespace std; #define ls(rt) rt*2
#define rs(rt) rt*2+1
#define ll long long
#define ull unsigned long long
#define rep(i,s,e) for(int i=s;i<e;i++)
#define repe(i,s,e) for(int i=s;i<=e;i++)
#define CL(a,b) memset(a,b,sizeof(a))
#define IN(s) freopen(s,"r",stdin)
#define OUT(s) freopen(s,"w",stdout)
const ll ll_INF = ((ull)(-1))>>1;
const double EPS = 1e-8;
const double pi = acos(-1.0);
const int INF = 100000000; const int MAXN = 1000+20; double t[MAXN],x[MAXN],y[MAXN];
struct Node {
double t,x,y;
}a[MAXN]; bool cmp(Node a, Node b){
return a.t<b.t;
} int main()
{
int ncase,n;
scanf("%d",&ncase);
while(ncase--)
{
scanf("%d",&n);
double ans=0.0;
for(int i=0;i<n;i++)
{
scanf("%lf%lf%lf",&a[i].t,&a[i].x,&a[i].y);
} for(int i=0;i<n-1;i++)
ans=max(ans,sqrt( (a[i].x-a[i+1].x)*(a[i].x-a[i+1].x)+(a[i].y-a[i+1].y)*(a[i].y-a[i+1].y) )/(a[i+1].t-a[i].t));
printf("%.10lf\n",ans);
}
return 0;
}
最新文章
- ACM: Gym 101047B Renzo and the palindromic decoration - 手速题
- linux top命令中各cpu占用率含义
- 向MySql数据库导入excel表数据
- 使用VS,获取SQL SERVER 的链接字符串
- 设计模式学习系列9 外观模式Facade
- Good Bye 2013
- 【BZOJ】【1272】【BeiJingWC2008】Gate of Babylon
- Collection_Compare
- Django1.6添加comments应用的简单过程
- CSS表格固定列宽
- BZOJ 1059 [ZJOI2007]矩阵游戏
- hdu1005 Number Sequence(寻找循环节)
- ABAP 开启制定路径下的文件或网址URL
- C++内存管理-new,delete,new[],placement new的简单使用
- Mysql 登录及用户切换、用户权限查询
- JDK8 特性详解
- 配置Zookeper
- CSU 1805 Three Capitals(矩阵树定理+Best定理)
- [UE4]产生开枪特效
- sublime text配置make工具