hdu 5112 A Curious Matt
2015-01-16 21:08
239 查看
http://acm.hdu.edu.cn/showproblem.php?pid=5112
View Code
#include <cstdio> #include <cstring> #include <algorithm> using namespace std; int t; int n; struct node { int t,x; bool operator<(const node &a)const { return t<a.t; } }p[10001]; int main() { scanf("%d",&t); for(int cas=1; cas<=t; cas++) { scanf("%d",&n); for(int i=0; i<n; i++) { scanf("%d%d",&p[i].t,&p[i].x); } sort(p,p+n); double ans=0; for(int i=1; i<n; i++) { double v=(double)(abs((p[i].x-p[i-1].x))*1.0/(p[i].t-p[i-1].t)); ans=max(ans,v); } printf("Case #%d: %.2lf\n",cas,ans); } return 0; }
View Code
相关文章推荐
- HDU 5112 A Curious Matt (水题)
- HDU 5112 2014ICPC北京站现场赛 A Curious Matt
- hdu 5112 A Curious Matt(排序)
- hdu 5112 A Curious Matt (结构体+cmp函数)
- hdu 5112 A Curious Matt
- HDU 5112 A Curious Matt 水题
- hdu 5112 A Curious Matt (水题)
- hdu 5112 A Curious Matt 2014ACM/ICPC亚洲区北京站-重现赛
- hdu-5112-A Curious Matt
- HDU 5112 A Curious Matt(水~)
- hdu 5112 A Curious Matt
- HDU 5112 A Curious Matt 水题
- HDU 5112 A Curious Matt (14北京 排序 水题)
- 【瞎搞】 HDU 5112 A Curious Matt 水
- HDU 5112 A Curious Matt && 2014ACM/ICPC亚洲区北京站(暴力)
- HDU 5112 A Curious Matt(2014亚洲区北京站现场赛)
- HDU 5112 A Curious Matt (Java comparator + 快速IO + 控制浮点精度)
- hdu 5112 A Curious Matt
- hdoj-5112-A Curious Matt
- HDOJ 5112 A Curious Matt 水题