| Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|---|
| 41404 | plj2026 | 【S】T1 | C++ | 解答错误 | 80 | 992 MS | 1816 KB | 858 | 2026-04-22 19:06:37 |
#include <bits/stdc++.h> using namespace std; #define int long long struct nd { double x, y; }; nd dis[100005]; bool cmp(nd xx, nd yy) { if ((xx.x+xx.y) != (yy.x+yy.y)) return (xx.x+xx.y) < (yy.x+yy.y); return (xx.x-xx.y) < (yy.x-yy.y); } double mhd(int x1, int y1, int x2, int y2) { return 1.0*abs(x1-x2) + 1.0*abs(y1-y2); } double jld(int x1, int y1, int x2, int y2) { return 1.0*sqrt(1.0*(x1-x2)*(x1-x2)+(y1-y2)*(y1-y2)); } signed main() { int t; cin >> t; while (t--) { int n; cin >> n; for (int i = 1; i <= n; i++) { cin >> dis[i].x >> dis[i].y; } sort(dis+1, dis+n+1, cmp); double maxn = 0; for (int i = 1; i < n; i++) { maxn = max(maxn,1.0*mhd(dis[i].x,dis[i].y,dis[i+1].x,dis[i+1].y)/ jld(dis[i].x,dis[i].y,dis[i+1].x,dis[i+1].y)); } printf("%.12lf\n", maxn); } return 0; }