結果
問題 | No.168 ものさし |
ユーザー |
|
提出日時 | 2024-05-07 12:02:01 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 798 bytes |
コンパイル時間 | 268 ms |
コンパイル使用メモリ | 82,560 KB |
実行使用メモリ | 76,288 KB |
最終ジャッジ日時 | 2024-11-30 04:36:30 |
合計ジャッジ時間 | 2,135 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 4 |
other | WA * 19 |
ソースコード
import sys import math def find_minimum_ruler_length(points): max_distance = 0 n = len(points) for i in range(n): for j in range(i + 1, n): x1, y1 = points[i] x2, y2 = points[j] distance = math.sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2) max_distance = max(max_distance, distance) return max_distance def main(): input = sys.stdin.read data = input().split() n = int(data[0]) # 点の数 points = [] index = 1 for _ in range(n): x = int(data[index]) y = int(data[index + 1]) points.append((x, y)) index += 2 minimum_ruler_length = find_minimum_ruler_length(points) print(f"{minimum_ruler_length:.6f}") if __name__ == "__main__": main()