結果

問題 No.1065 電柱 / Pole (Easy)
ユーザー c-yanc-yan
提出日時 2020-06-02 22:42:50
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 878 ms / 2,000 ms
コード長 425 bytes
コンパイル時間 1,365 ms
コンパイル使用メモリ 87,068 KB
実行使用メモリ 144,028 KB
最終ジャッジ日時 2023-08-16 05:25:52
合計ジャッジ時間 19,907 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 79 ms
72,340 KB
testcase_01 AC 79 ms
72,092 KB
testcase_02 AC 420 ms
111,164 KB
testcase_03 AC 405 ms
135,928 KB
testcase_04 AC 494 ms
136,084 KB
testcase_05 AC 313 ms
142,392 KB
testcase_06 AC 298 ms
142,520 KB
testcase_07 AC 168 ms
91,392 KB
testcase_08 AC 367 ms
144,028 KB
testcase_09 AC 135 ms
84,736 KB
testcase_10 AC 220 ms
107,440 KB
testcase_11 AC 194 ms
98,824 KB
testcase_12 AC 171 ms
90,384 KB
testcase_13 AC 628 ms
114,672 KB
testcase_14 AC 500 ms
122,784 KB
testcase_15 AC 706 ms
131,584 KB
testcase_16 AC 436 ms
100,724 KB
testcase_17 AC 878 ms
134,648 KB
testcase_18 AC 316 ms
94,284 KB
testcase_19 AC 746 ms
133,004 KB
testcase_20 AC 243 ms
93,260 KB
testcase_21 AC 384 ms
98,572 KB
testcase_22 AC 537 ms
125,424 KB
testcase_23 AC 100 ms
78,476 KB
testcase_24 AC 104 ms
78,412 KB
testcase_25 AC 162 ms
87,828 KB
testcase_26 AC 438 ms
110,084 KB
testcase_27 AC 383 ms
108,052 KB
testcase_28 AC 542 ms
128,536 KB
testcase_29 AC 167 ms
84,672 KB
testcase_30 AC 580 ms
137,788 KB
testcase_31 AC 322 ms
113,008 KB
testcase_32 AC 252 ms
101,832 KB
testcase_33 AC 439 ms
133,628 KB
testcase_34 AC 277 ms
94,536 KB
testcase_35 AC 540 ms
137,328 KB
testcase_36 AC 108 ms
78,744 KB
testcase_37 AC 110 ms
78,884 KB
testcase_38 AC 107 ms
78,720 KB
testcase_39 AC 113 ms
79,260 KB
testcase_40 AC 100 ms
78,308 KB
testcase_41 AC 597 ms
143,388 KB
testcase_42 AC 231 ms
97,484 KB
testcase_43 AC 342 ms
109,560 KB
testcase_44 AC 205 ms
91,748 KB
testcase_45 AC 334 ms
111,608 KB
testcase_46 AC 82 ms
71,932 KB
testcase_47 AC 80 ms
72,244 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
from collections import deque
r=lambda:list(map(int,sys.stdin.readline().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=[9e9]*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