結果

問題 No.2179 Planet Traveler
ユーザー 👑 p-adicp-adic
提出日時 2023-05-30 02:27:04
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 502 bytes
コンパイル時間 92 ms
コンパイル使用メモリ 10,948 KB
実行使用メモリ 8,648 KB
最終ジャッジ日時 2023-08-28 00:21:26
合計ジャッジ時間 1,891 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
8,236 KB
testcase_01 AC 17 ms
8,168 KB
testcase_02 AC 16 ms
8,104 KB
testcase_03 AC 16 ms
8,120 KB
testcase_04 AC 16 ms
8,352 KB
testcase_05 AC 16 ms
8,236 KB
testcase_06 AC 16 ms
8,204 KB
testcase_07 AC 16 ms
8,348 KB
testcase_08 AC 16 ms
8,320 KB
testcase_09 AC 16 ms
8,392 KB
testcase_10 AC 16 ms
8,304 KB
testcase_11 AC 20 ms
8,520 KB
testcase_12 AC 20 ms
8,420 KB
testcase_13 AC 20 ms
8,376 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 21 ms
8,524 KB
testcase_18 AC 20 ms
8,028 KB
testcase_19 AC 20 ms
8,604 KB
testcase_20 WA -
testcase_21 AC 20 ms
8,564 KB
testcase_22 AC 19 ms
8,044 KB
testcase_23 AC 19 ms
7,928 KB
testcase_24 AC 20 ms
7,864 KB
testcase_25 AC 19 ms
8,544 KB
testcase_26 AC 19 ms
8,452 KB
testcase_27 AC 18 ms
8,380 KB
testcase_28 AC 19 ms
8,452 KB
testcase_29 AC 20 ms
8,492 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:
		l=D[j][0]
		p=4*l*d[0]
		r=int(math.sqrt(p))+1
		while p<r**2:r-=1
		u=l+d[0]-r
		if t>u:i,t=j,u
	s=max(s,t)
print(s)
0