結果

問題 No.168 ものさし
ユーザー 佐藤悠佐藤悠
提出日時 2023-06-03 03:12:29
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 575 bytes
コンパイル時間 226 ms
コンパイル使用メモリ 10,932 KB
実行使用メモリ 24,552 KB
最終ジャッジ日時 2023-08-28 07:35:02
合計ジャッジ時間 7,543 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 -- -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
権限があれば一括ダウンロードができます

ソースコード

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