結果

問題 No.1065 電柱 / Pole (Easy)
ユーザー c-yanc-yan
提出日時 2020-06-02 22:18:40
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,368 ms / 2,000 ms
コード長 405 bytes
コンパイル時間 891 ms
コンパイル使用メモリ 86,888 KB
実行使用メモリ 145,004 KB
最終ジャッジ日時 2023-08-16 04:47:29
合計ジャッジ時間 25,492 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 89 ms
72,028 KB
testcase_01 AC 88 ms
71,924 KB
testcase_02 AC 518 ms
111,528 KB
testcase_03 AC 580 ms
145,004 KB
testcase_04 AC 673 ms
144,956 KB
testcase_05 AC 467 ms
143,832 KB
testcase_06 AC 462 ms
143,612 KB
testcase_07 AC 251 ms
96,060 KB
testcase_08 AC 530 ms
139,180 KB
testcase_09 AC 185 ms
84,696 KB
testcase_10 AC 323 ms
107,656 KB
testcase_11 AC 274 ms
99,264 KB
testcase_12 AC 232 ms
89,276 KB
testcase_13 AC 919 ms
115,352 KB
testcase_14 AC 672 ms
122,356 KB
testcase_15 AC 961 ms
132,292 KB
testcase_16 AC 549 ms
100,948 KB
testcase_17 AC 1,368 ms
136,208 KB
testcase_18 AC 423 ms
95,324 KB
testcase_19 AC 1,061 ms
131,656 KB
testcase_20 AC 324 ms
92,496 KB
testcase_21 AC 500 ms
99,108 KB
testcase_22 AC 745 ms
124,672 KB
testcase_23 AC 127 ms
78,564 KB
testcase_24 AC 129 ms
79,264 KB
testcase_25 AC 224 ms
89,568 KB
testcase_26 AC 585 ms
109,848 KB
testcase_27 AC 483 ms
107,496 KB
testcase_28 AC 709 ms
125,320 KB
testcase_29 AC 227 ms
85,764 KB
testcase_30 AC 750 ms
136,504 KB
testcase_31 AC 472 ms
119,116 KB
testcase_32 AC 359 ms
104,448 KB
testcase_33 AC 587 ms
132,036 KB
testcase_34 AC 376 ms
95,888 KB
testcase_35 AC 750 ms
135,724 KB
testcase_36 AC 135 ms
79,128 KB
testcase_37 AC 153 ms
78,952 KB
testcase_38 AC 139 ms
79,016 KB
testcase_39 AC 168 ms
79,196 KB
testcase_40 AC 120 ms
78,464 KB
testcase_41 AC 857 ms
143,780 KB
testcase_42 AC 350 ms
99,520 KB
testcase_43 AC 498 ms
112,928 KB
testcase_44 AC 270 ms
88,024 KB
testcase_45 AC 479 ms
112,344 KB
testcase_46 AC 91 ms
72,108 KB
testcase_47 AC 90 ms
72,024 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import deque
r=lambda:list(map(int,input().split()))
N,M=r()
X,Y=r()
p=[r() for _ in range(N)]
P=[r() for _ in range(M)]
l=[[]for _ in range(N)]
for a,b in P:
	l[a-1].append(b-1)
	l[b-1].append(a-1)
q=deque([X-1])
t=[1e20]*N
t[X-1]=0
while q:
	i=q.popleft()
	for j in l[i]:
		a,b=p[i]
		c,d=p[j]
		k=t[i]+((a-c)*(a-c)+(b-d)*(b-d))**0.5
		if k<t[j]:
			t[j]=k
			q.append(j)
print(t[Y-1])
0