結果

問題 No.1065 電柱 / Pole (Easy)
ユーザー c-yanc-yan
提出日時 2020-06-02 22:38:32
言語 PyPy3
(7.3.13)
結果
TLE  
実行時間 -
コード長 427 bytes
コンパイル時間 1,476 ms
コンパイル使用メモリ 87,180 KB
実行使用メモリ 143,628 KB
最終ジャッジ日時 2023-08-16 05:17:31
合計ジャッジ時間 10,218 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 80 ms
72,172 KB
testcase_01 AC 81 ms
71,604 KB
testcase_02 AC 330 ms
110,504 KB
testcase_03 AC 785 ms
136,700 KB
testcase_04 AC 717 ms
136,916 KB
testcase_05 AC 319 ms
142,256 KB
testcase_06 AC 328 ms
142,056 KB
testcase_07 AC 175 ms
91,512 KB
testcase_08 AC 369 ms
143,628 KB
testcase_09 AC 135 ms
84,660 KB
testcase_10 AC 224 ms
107,076 KB
testcase_11 AC 199 ms
98,456 KB
testcase_12 AC 182 ms
90,032 KB
testcase_13 TLE -
testcase_14 AC 1,691 ms
122,464 KB
testcase_15 TLE -
testcase_16 TLE -
testcase_17 TLE -
testcase_18 AC 1,814 ms
96,092 KB
testcase_19 AC 1,738 ms
132,916 KB
testcase_20 AC 342 ms
92,592 KB
testcase_21 TLE -
testcase_22 AC 756 ms
125,432 KB
testcase_23 AC 101 ms
78,452 KB
testcase_24 AC 101 ms
78,804 KB
testcase_25 AC 160 ms
87,624 KB
testcase_26 AC 603 ms
110,580 KB
testcase_27 AC 578 ms
108,120 KB
testcase_28 AC 747 ms
128,924 KB
testcase_29 AC 197 ms
84,784 KB
testcase_30 AC 709 ms
136,600 KB
testcase_31 AC 335 ms
113,044 KB
testcase_32 AC 290 ms
101,720 KB
testcase_33 AC 454 ms
131,928 KB
testcase_34 AC 373 ms
97,104 KB
testcase_35 AC 900 ms
137,596 KB
testcase_36 AC 120 ms
78,700 KB
testcase_37 AC 125 ms
78,664 KB
testcase_38 AC 114 ms
78,652 KB
testcase_39 AC 120 ms
79,208 KB
testcase_40 AC 97 ms
78,412 KB
testcase_41 AC 590 ms
143,556 KB
testcase_42 AC 225 ms
97,696 KB
testcase_43 AC 326 ms
109,748 KB
testcase_44 AC 192 ms
92,092 KB
testcase_45 AC 333 ms
111,676 KB
testcase_46 AC 81 ms
72,052 KB
testcase_47 AC 84 ms
72,280 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
from collections import deque
s=sys.stdin.readline
r=lambda:list(map(int,s().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.pop()
	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