結果
| 問題 | No.168 ものさし |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-05-07 12:02:01 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 798 bytes |
| 記録 | |
| コンパイル時間 | 140 ms |
| コンパイル使用メモリ | 84,992 KB |
| 実行使用メモリ | 80,896 KB |
| 最終ジャッジ日時 | 2026-05-23 21:30:19 |
| 合計ジャッジ時間 | 1,848 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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()