HDU5112【水】
2016-09-19 22:31
267 查看
#include <bits/stdc++.h> using namespace std; typedef long long LL; const int N=1e4+10; struct asd{ double time; double x; }; asd d ; int n; bool cmp(asd a,asd b) { return a.time<b.time; } int main() { int T; int cas=1; scanf("%d",&T); while(T--) { scanf("%d",&n); for(int i=0;i<n;i++) scanf("%lf%lf",&d[i].time,&d[i].x); sort(d,d+n,cmp); double ans=0; for(int i=1;i<n;i++) { double tmp=fabs(d[i].x-d[i-1].x)/(d[i].time-d[i-1].time); if(tmp>ans) ans=tmp; } printf("Case #%d: ",cas++); printf("%.2lf\n",ans); } return 0; }
相关文章推荐
- 反转单链表的几种方法
- linux系统分区day0919
- 实验二:跨交换机实现VLAN
- 2016 ACM/ICPC Asia Regional Shenyang Online HDU 5894 hannnnah_j’s Biological Test
- 21、在选择的时候跳到另一页面上,选择男女,然后提交表单内容
- Linux Linux程序练习十(网络编程大文件发送)
- 关于dubbo服务的xml配置文件报错的问题
- 内存对齐
- ios 关于PNG和JPEG格式压缩
- deBug日志_关于android studio导入9.png导致编译报错
- pthread_mutex_init等多线程函数的使用总结
- rtmp指令解释--转
- spring.hibernate设置参数的位置问题
- Pure表格
- 快速排序法!!
- Java的<init>,<cinit>与类的初始化顺序
- this_JAVA
- 项目管理一般知识
- 【NOIP2011】聪明的质检员
- HDU5119【dp背包求方案数】