标签:return help ott highlight may test acm wan with
Time Limit: 2000/2000 MS (Java/Others) Memory Limit: 512000/512000 K (Java/Others)
Total Submission(s): 3369 Accepted Submission(s): 1876
#include <bits/stdc++.h>
using namespace std;
const int maxn = 10010;
struct node
{
int t, x;
}a[maxn];
bool cmp(node a, node b)
{
return a.t < b.t;
}
int main()
{
int t;
scanf("%d", &t);
for(int k = 1; k <= t; k++)
{
int n;
scanf("%d", &n);
for(int i = 0; i < n; i++)
scanf("%d%d", &a[i].t, &a[i].x);
sort(a, a + n, cmp);
double ans = 0;
for(int i = 1; i < n; i++)
{
double cur = (a[i].x - a[i - 1].x) * 1.0 / (a[i].t - a[i - 1].t);
cur = fabs(cur);
ans = max(ans, cur);
}
printf("Case #%d: %.2f\n", k, ans);
}
return 0;
}
标签:return help ott highlight may test acm wan with
原文地址:https://www.cnblogs.com/songorz/p/9710540.html