結果

問題 No.168 ものさし
ユーザー 佐藤悠
提出日時 2023-06-03 03:12:29
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
TLE  
実行時間 -
コード長 575 bytes
コンパイル時間 240 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 29,000 KB
最終ジャッジ日時 2024-12-29 02:29:24
合計ジャッジ時間 42,962 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 5 WA * 2 TLE * 12
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
xy = [list(map(int,input().split())) for i in range(n)]
import math
def naga(x1,x2):
    d = math.sqrt((xy[x1][1]-xy[x2][1])**2+(xy[x1][0]-xy[x2][0])**2)
    return d
l = 0
r = naga(0,-1)//10+2
while r>=l:
    mid = (r+l)//2
    visi = [False]*n
    d = []
    d.append(0)
    while d:
        pos = d.pop(0)
        visi[pos] = True
        for i in range(n):
            if i == pos: continue
            if naga(i,pos)<mid*10 and visi[i] == False:
                d.append(i)
    if visi[-1]:
        r = mid-1
    else:
        l = mid+1
print(int(l*10))
0