結果

問題 No.2179 Planet Traveler
ユーザー 👑 p-adicp-adic
提出日時 2023-05-30 02:15:32
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 468 bytes
コンパイル時間 731 ms
コンパイル使用メモリ 10,784 KB
実行使用メモリ 8,644 KB
最終ジャッジ日時 2023-08-28 00:20:47
合計ジャッジ時間 2,060 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
8,260 KB
testcase_01 AC 15 ms
8,376 KB
testcase_02 AC 15 ms
8,380 KB
testcase_03 AC 16 ms
8,316 KB
testcase_04 AC 14 ms
8,376 KB
testcase_05 AC 15 ms
8,372 KB
testcase_06 AC 15 ms
8,288 KB
testcase_07 AC 15 ms
8,300 KB
testcase_08 AC 15 ms
8,304 KB
testcase_09 AC 15 ms
8,316 KB
testcase_10 AC 15 ms
8,352 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 18 ms
8,492 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 19 ms
8,492 KB
testcase_18 AC 18 ms
8,396 KB
testcase_19 AC 19 ms
8,080 KB
testcase_20 WA -
testcase_21 AC 18 ms
8,468 KB
testcase_22 AC 18 ms
7,976 KB
testcase_23 AC 17 ms
8,088 KB
testcase_24 AC 19 ms
8,540 KB
testcase_25 AC 18 ms
8,520 KB
testcase_26 AC 19 ms
8,408 KB
testcase_27 AC 16 ms
8,428 KB
testcase_28 AC 17 ms
8,452 KB
testcase_29 AC 18 ms
8,404 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import math
I,R,S=input,range,math.sqrt
def J():
	return map(int,I().split())
N=int(I())
D=[0]*N
for i in R(N):
	X,Y,T=J()
	D[i]=[X*X+Y*Y,X,Y,T,i]
D.sort()
for i in R(N):
	j=D[i][4]
	if j<1:o=i
	if j>N-2:n=i
if n<o:o,n=n,o
s=0
i=o
while i<n:
	t,j=3200000001,i+1
	d=D[i]
	while j<=n:
		if d[3]!=D[j][3]:break
		u=(D[j][1]-d[1])**2+(D[j][2]-d[2])**2
		if t>u:i,t=j,u
		j=j+1
	if j<=n:
		r=D[j][0]
		u=r+d[0]-int(2*math.sqrt(r*d[0]))
		if t>u:i,t=j,u
	s=max(s,t)
print(s)
0