結果

問題 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
コンパイル時間 367 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 11,136 KB
最終ジャッジ日時 2024-06-08 19:54:26
合計ジャッジ時間 2,253 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 25 ms
10,880 KB
testcase_01 AC 26 ms
10,880 KB
testcase_02 AC 25 ms
10,880 KB
testcase_03 AC 25 ms
10,880 KB
testcase_04 AC 24 ms
10,880 KB
testcase_05 AC 24 ms
10,880 KB
testcase_06 AC 24 ms
10,880 KB
testcase_07 AC 24 ms
11,008 KB
testcase_08 AC 24 ms
10,880 KB
testcase_09 AC 24 ms
10,880 KB
testcase_10 AC 24 ms
10,880 KB
testcase_11 AC 29 ms
11,136 KB
testcase_12 AC 27 ms
11,136 KB
testcase_13 AC 28 ms
11,008 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 29 ms
11,008 KB
testcase_18 AC 30 ms
11,008 KB
testcase_19 AC 28 ms
11,008 KB
testcase_20 WA -
testcase_21 AC 27 ms
11,136 KB
testcase_22 AC 28 ms
11,008 KB
testcase_23 AC 27 ms
11,008 KB
testcase_24 AC 27 ms
11,008 KB
testcase_25 AC 27 ms
11,136 KB
testcase_26 AC 28 ms
11,008 KB
testcase_27 AC 25 ms
10,880 KB
testcase_28 AC 26 ms
10,880 KB
testcase_29 AC 28 ms
11,008 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