結果

問題 No.807 umg tours
ユーザー yuruhiyayuruhiya
提出日時 2020-09-06 10:45:58
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
MLE  
(最新)
AC  
(最初)
実行時間 -
コード長 465 bytes
コンパイル時間 1,058 ms
コンパイル使用メモリ 10,908 KB
実行使用メモリ 608,016 KB
最終ジャッジ日時 2023-08-19 13:37:03
合計ジャッジ時間 28,311 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 173 ms
43,596 KB
testcase_01 AC 188 ms
43,852 KB
testcase_02 AC 177 ms
44,176 KB
testcase_03 AC 177 ms
44,064 KB
testcase_04 AC 172 ms
43,644 KB
testcase_05 AC 176 ms
43,936 KB
testcase_06 AC 180 ms
44,140 KB
testcase_07 AC 176 ms
43,832 KB
testcase_08 AC 174 ms
43,360 KB
testcase_09 AC 170 ms
43,232 KB
testcase_10 AC 175 ms
43,340 KB
testcase_11 AC 1,732 ms
266,532 KB
testcase_12 AC 1,267 ms
187,492 KB
testcase_13 AC 1,844 ms
261,700 KB
testcase_14 AC 876 ms
134,220 KB
testcase_15 AC 731 ms
117,256 KB
testcase_16 AC 2,036 ms
280,080 KB
testcase_17 AC 2,274 ms
302,928 KB
testcase_18 AC 2,365 ms
303,392 KB
testcase_19 AC 2,509 ms
302,836 KB
testcase_20 AC 1,441 ms
164,792 KB
testcase_21 AC 1,304 ms
169,876 KB
testcase_22 AC 618 ms
98,448 KB
testcase_23 AC 505 ms
87,244 KB
testcase_24 AC 1,693 ms
235,000 KB
testcase_25 MLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

from numpy import*
from scipy.sparse import*
from sys import stdin
n,m=map(int,stdin.readline().split())
e=[]
for i in range(m):
    a,b,c=map(int,stdin.readline().split())
    for _ in [0,0]:
        e.append([a,b,c])
        e.append([a,b+n,0])
        e.append([a+n,b+n,c])
        a,b=b,a
edge=array(e,int64).T
graph=csr_matrix((edge[2],edge[:2]-1),(n+n,n+n))
dist=csgraph.dijkstra(graph,True,0)
for i in range(n):
    print(int(dist[i]+min(dist[i],dist[i+n])))
0