首页 > 其他 > 详细

hdu--5078--orz

时间:2014-11-23 12:57:50      阅读:109      评论:0      收藏:0      [点我收藏+]

这应该是当时 鞍山的签到题了吧...

可以给大一的来做下 .

bubuko.com,布布扣
 1 #include <iostream>
 2 #include <cmath>
 3 #include <iomanip>
 4 using namespace std;
 5 
 6 double Abs( double x )
 7 {
 8     return x > 0 ? x : -x;
 9 }
10 
11 int main()
12 {
13     cin.sync_with_stdio(false);
14     int t , n;
15     double t1 , x1 , y1 , t2 , x2 , y2 , var , ans;
16     cin >> t;
17     while( t-- )
18     {
19         cin >> n;
20         cin >> t1 >> x1 >> y1;
21         ans = 0;
22         for( int i = 2 ; i<=n ; i++ )
23         {
24             cin >> t2 >> x2 >> y2;
25             var = sqrt( Abs(x2-x1)*Abs(x2-x1) + Abs(y2-y1)*Abs(y2-y1) ) / Abs(t2-t1);
26             ans = max( var , ans );
27             t1 = t2;
28             x1 = x2;
29             y1 = y2;
30         }
31         cout << setiosflags(ios::fixed);
32         cout << setprecision(10) << ans << endl;
33     }
34     return 0;
35 }
View Code

早上写了2题  晓爷你TMD 是不是还在睡觉!!

hdu--5078--orz

原文:http://www.cnblogs.com/radical/p/4116317.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!