結果

問題 No.2179 Planet Traveler
ユーザー ntudantuda
提出日時 2023-01-26 20:24:56
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 637 bytes
コンパイル時間 528 ms
コンパイル使用メモリ 87,212 KB
実行使用メモリ 87,284 KB
最終ジャッジ日時 2023-09-09 19:16:53
合計ジャッジ時間 6,575 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
76,252 KB
testcase_01 AC 75 ms
71,876 KB
testcase_02 AC 72 ms
71,764 KB
testcase_03 AC 72 ms
71,676 KB
testcase_04 AC 73 ms
71,668 KB
testcase_05 AC 73 ms
71,636 KB
testcase_06 AC 75 ms
71,748 KB
testcase_07 AC 74 ms
71,712 KB
testcase_08 AC 91 ms
76,844 KB
testcase_09 WA -
testcase_10 AC 89 ms
77,032 KB
testcase_11 TLE -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import ceil
from heapq import *

N = int(input())
XYT = [list(map(int, input().split())) for _ in range(N)]
dist = [[0] * N for _ in range(N)]
for i in range(N):
    x1, y1, t1 = XYT[i]
    for j in range(i, N):
        x2, y2, t2 = XYT[j]
        if t1 == t2:
            dist[i][j] = dist[j][i] = ((x1 - x2) ** 2 + (y1 - y2) ** 2) ** 0.5
        else:
            dist[i][j] = dist[j][i] = abs((x1 ** 2 + y1 ** 2) ** 0.5 - (x2 ** 2 + y2 ** 2) ** 0.5)

for i in range(N):
    for j in range(N):
        for k in range(N):
            dist[i][j] = min(dist[i][j], max(dist[i][k], dist[k][j]))

print(ceil(dist[0][N - 1] ** 2))
0