結果

問題 No.1065 電柱 / Pole (Easy)
ユーザー c-yanc-yan
提出日時 2020-06-02 22:13:51
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 776 ms / 2,000 ms
コード長 404 bytes
コンパイル時間 151 ms
コンパイル使用メモリ 82,700 KB
実行使用メモリ 142,724 KB
最終ジャッジ日時 2024-05-03 13:57:01
合計ジャッジ時間 16,850 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
55,200 KB
testcase_01 AC 37 ms
55,288 KB
testcase_02 AC 316 ms
105,668 KB
testcase_03 AC 408 ms
135,528 KB
testcase_04 AC 453 ms
135,524 KB
testcase_05 AC 357 ms
141,256 KB
testcase_06 AC 351 ms
141,160 KB
testcase_07 AC 186 ms
92,740 KB
testcase_08 AC 422 ms
142,724 KB
testcase_09 AC 117 ms
81,948 KB
testcase_10 AC 238 ms
102,544 KB
testcase_11 AC 191 ms
97,084 KB
testcase_12 AC 158 ms
89,156 KB
testcase_13 AC 559 ms
114,072 KB
testcase_14 AC 479 ms
120,172 KB
testcase_15 AC 659 ms
128,116 KB
testcase_16 AC 392 ms
100,532 KB
testcase_17 AC 776 ms
133,328 KB
testcase_18 AC 280 ms
93,472 KB
testcase_19 AC 690 ms
132,900 KB
testcase_20 AC 228 ms
89,052 KB
testcase_21 AC 361 ms
97,256 KB
testcase_22 AC 538 ms
122,344 KB
testcase_23 AC 75 ms
77,556 KB
testcase_24 AC 79 ms
77,608 KB
testcase_25 AC 152 ms
87,536 KB
testcase_26 AC 410 ms
108,044 KB
testcase_27 AC 343 ms
107,132 KB
testcase_28 AC 495 ms
127,904 KB
testcase_29 AC 149 ms
83,408 KB
testcase_30 AC 549 ms
129,320 KB
testcase_31 AC 342 ms
113,004 KB
testcase_32 AC 248 ms
99,500 KB
testcase_33 AC 426 ms
129,436 KB
testcase_34 AC 270 ms
93,224 KB
testcase_35 AC 531 ms
135,336 KB
testcase_36 AC 81 ms
78,112 KB
testcase_37 AC 97 ms
78,676 KB
testcase_38 AC 87 ms
77,528 KB
testcase_39 AC 106 ms
78,252 KB
testcase_40 AC 66 ms
72,620 KB
testcase_41 AC 636 ms
142,616 KB
testcase_42 AC 244 ms
95,624 KB
testcase_43 AC 365 ms
110,824 KB
testcase_44 AC 185 ms
90,452 KB
testcase_45 AC 345 ms
110,692 KB
testcase_46 AC 39 ms
55,324 KB
testcase_47 AC 35 ms
55,248 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