HDU - 5078 水题
题意:最大困难=距离 / 相邻时间
#include<cstring> #include<cstdio> #include<cmath> #define ll double ll num[3][1001]; #define max(a, b) (a)>(b)?(a):(b) int main() { int t; scanf("%d", &t); while (t--) { int n; scanf("%d", &n); for (int i = 0; i < n; ++i) scanf("%lf%lf%lf", &num[0][i], &num[1][i], &num[2][i]); double ans = 0; for (int i = 1; i < n; ++i) { double kk= sqrt((num[1][i] - num[1][i - 1])*(num[1][i] - num[1][i - 1]) + (num[2][i] - num[2][i - 1])*(num[2][i] - num[2][i - 1]))/(num[0][i]-num[0][i-1]*1.0); ans = max(ans, kk); } printf("%.10lf\n", ans); } }