結果

問題 No.1065 電柱 / Pole (Easy)
ユーザー c-yanc-yan
提出日時 2020-06-02 22:13:51
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,468 ms / 2,000 ms
コード長 404 bytes
コンパイル時間 492 ms
コンパイル使用メモリ 86,748 KB
実行使用メモリ 145,164 KB
最終ジャッジ日時 2023-08-16 04:35:57
合計ジャッジ時間 27,274 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 99 ms
71,852 KB
testcase_01 AC 100 ms
71,932 KB
testcase_02 AC 592 ms
111,452 KB
testcase_03 AC 590 ms
145,164 KB
testcase_04 AC 687 ms
144,820 KB
testcase_05 AC 495 ms
143,472 KB
testcase_06 AC 485 ms
143,224 KB
testcase_07 AC 265 ms
95,544 KB
testcase_08 AC 558 ms
139,300 KB
testcase_09 AC 197 ms
84,508 KB
testcase_10 AC 343 ms
107,260 KB
testcase_11 AC 286 ms
98,876 KB
testcase_12 AC 249 ms
89,104 KB
testcase_13 AC 1,088 ms
115,152 KB
testcase_14 AC 782 ms
122,632 KB
testcase_15 AC 1,140 ms
132,200 KB
testcase_16 AC 619 ms
100,696 KB
testcase_17 AC 1,468 ms
135,876 KB
testcase_18 AC 461 ms
95,392 KB
testcase_19 AC 1,246 ms
131,280 KB
testcase_20 AC 353 ms
92,308 KB
testcase_21 AC 552 ms
99,020 KB
testcase_22 AC 869 ms
124,212 KB
testcase_23 AC 140 ms
78,640 KB
testcase_24 AC 143 ms
78,840 KB
testcase_25 AC 238 ms
89,248 KB
testcase_26 AC 735 ms
109,780 KB
testcase_27 AC 587 ms
107,320 KB
testcase_28 AC 850 ms
125,144 KB
testcase_29 AC 246 ms
85,440 KB
testcase_30 AC 890 ms
136,124 KB
testcase_31 AC 523 ms
119,100 KB
testcase_32 AC 387 ms
104,248 KB
testcase_33 AC 672 ms
131,812 KB
testcase_34 AC 423 ms
95,992 KB
testcase_35 AC 841 ms
135,056 KB
testcase_36 AC 148 ms
78,948 KB
testcase_37 AC 166 ms
78,900 KB
testcase_38 AC 151 ms
78,800 KB
testcase_39 AC 170 ms
78,664 KB
testcase_40 AC 126 ms
78,164 KB
testcase_41 AC 850 ms
143,764 KB
testcase_42 AC 366 ms
99,032 KB
testcase_43 AC 513 ms
112,724 KB
testcase_44 AC 278 ms
88,032 KB
testcase_45 AC 497 ms
112,008 KB
testcase_46 AC 97 ms
71,772 KB
testcase_47 AC 96 ms
71,868 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=[1e9]*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