結果

問題 No.1065 電柱 / Pole (Easy)
ユーザー c-yanc-yan
提出日時 2020-06-02 22:29:31
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,729 ms / 2,000 ms
コード長 415 bytes
コンパイル時間 295 ms
コンパイル使用メモリ 87,000 KB
実行使用メモリ 144,868 KB
最終ジャッジ日時 2023-08-16 05:04:19
合計ジャッジ時間 27,433 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 91 ms
71,928 KB
testcase_01 AC 91 ms
71,704 KB
testcase_02 AC 417 ms
111,276 KB
testcase_03 AC 579 ms
144,624 KB
testcase_04 AC 541 ms
144,772 KB
testcase_05 AC 447 ms
144,752 KB
testcase_06 AC 455 ms
144,868 KB
testcase_07 AC 243 ms
95,392 KB
testcase_08 AC 483 ms
139,008 KB
testcase_09 AC 179 ms
84,192 KB
testcase_10 AC 298 ms
107,316 KB
testcase_11 AC 255 ms
98,888 KB
testcase_12 AC 209 ms
89,048 KB
testcase_13 AC 1,667 ms
116,144 KB
testcase_14 AC 1,289 ms
122,016 KB
testcase_15 AC 1,526 ms
131,552 KB
testcase_16 AC 1,424 ms
101,288 KB
testcase_17 AC 1,729 ms
134,896 KB
testcase_18 AC 907 ms
95,164 KB
testcase_19 AC 1,192 ms
131,344 KB
testcase_20 AC 325 ms
92,396 KB
testcase_21 AC 1,282 ms
98,780 KB
testcase_22 AC 609 ms
124,640 KB
testcase_23 AC 126 ms
78,160 KB
testcase_24 AC 130 ms
78,876 KB
testcase_25 AC 197 ms
89,128 KB
testcase_26 AC 502 ms
110,260 KB
testcase_27 AC 502 ms
107,224 KB
testcase_28 AC 643 ms
125,016 KB
testcase_29 AC 215 ms
85,424 KB
testcase_30 AC 631 ms
136,128 KB
testcase_31 AC 405 ms
119,000 KB
testcase_32 AC 330 ms
104,288 KB
testcase_33 AC 483 ms
131,788 KB
testcase_34 AC 349 ms
95,764 KB
testcase_35 AC 774 ms
135,924 KB
testcase_36 AC 137 ms
78,688 KB
testcase_37 AC 158 ms
78,688 KB
testcase_38 AC 138 ms
78,108 KB
testcase_39 AC 162 ms
78,840 KB
testcase_40 AC 118 ms
78,076 KB
testcase_41 AC 640 ms
143,400 KB
testcase_42 AC 294 ms
98,888 KB
testcase_43 AC 408 ms
112,876 KB
testcase_44 AC 232 ms
87,904 KB
testcase_45 AC 399 ms
111,808 KB
testcase_46 AC 91 ms
71,712 KB
testcase_47 AC 91 ms
71,472 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import math
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.pop()
	for j in l[i]:
		a,b=p[i]
		c,d=p[j]
		k=t[i]+math.sqrt((a-c)*(a-c)+(b-d)*(b-d))
		if k<t[j]:
			t[j]=k
			q.append(j)
print(t[Y-1])
0