結果

問題 No.1065 電柱 / Pole (Easy)
ユーザー c-yanc-yan
提出日時 2020-06-02 22:15:29
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 427 bytes
コンパイル時間 217 ms
コンパイル使用メモリ 10,936 KB
実行使用メモリ 124,128 KB
最終ジャッジ日時 2023-08-16 04:39:11
合計ジャッジ時間 25,423 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
8,696 KB
testcase_01 AC 15 ms
8,836 KB
testcase_02 AC 769 ms
65,396 KB
testcase_03 AC 1,578 ms
102,264 KB
testcase_04 TLE -
testcase_05 AC 973 ms
94,524 KB
testcase_06 AC 956 ms
94,508 KB
testcase_07 AC 286 ms
39,248 KB
testcase_08 AC 1,238 ms
124,128 KB
testcase_09 AC 103 ms
18,568 KB
testcase_10 AC 497 ms
60,096 KB
testcase_11 AC 339 ms
43,912 KB
testcase_12 AC 330 ms
29,192 KB
testcase_13 TLE -
testcase_14 AC 1,424 ms
73,616 KB
testcase_15 TLE -
testcase_16 AC 1,381 ms
45,024 KB
testcase_17 TLE -
testcase_18 AC 876 ms
35,820 KB
testcase_19 TLE -
testcase_20 AC 495 ms
31,476 KB
testcase_21 AC 1,565 ms
41,996 KB
testcase_22 AC 1,681 ms
79,900 KB
testcase_23 AC 31 ms
9,660 KB
testcase_24 AC 32 ms
9,800 KB
testcase_25 AC 296 ms
26,900 KB
testcase_26 AC 1,273 ms
51,948 KB
testcase_27 AC 1,039 ms
51,712 KB
testcase_28 AC 1,673 ms
78,668 KB
testcase_29 AC 290 ms
18,824 KB
testcase_30 AC 1,756 ms
85,592 KB
testcase_31 AC 801 ms
63,632 KB
testcase_32 AC 476 ms
44,708 KB
testcase_33 AC 1,172 ms
82,312 KB
testcase_34 AC 723 ms
37,768 KB
testcase_35 AC 1,597 ms
86,420 KB
testcase_36 AC 27 ms
9,240 KB
testcase_37 AC 31 ms
9,912 KB
testcase_38 AC 27 ms
9,288 KB
testcase_39 AC 30 ms
9,872 KB
testcase_40 AC 20 ms
8,876 KB
testcase_41 AC 1,603 ms
123,700 KB
testcase_42 AC 407 ms
44,064 KB
testcase_43 AC 795 ms
69,496 KB
testcase_44 AC 462 ms
31,028 KB
testcase_45 AC 1,495 ms
68,160 KB
testcase_46 AC 17 ms
8,640 KB
testcase_47 AC 15 ms
8,968 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=[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