結果
問題 |
No.1473 おでぶなおばけさん
|
ユーザー |
|
提出日時 | 2022-10-07 11:24:59 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
RE
|
実行時間 | - |
コード長 | 503 bytes |
コンパイル時間 | 300 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 324,668 KB |
最終ジャッジ日時 | 2024-06-11 19:12:26 |
合計ジャッジ時間 | 6,775 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | RE * 2 |
other | TLE * 1 -- * 46 |
ソースコード
import numpy as np from scipy.sparse.csgraph import dijkstra from scipy.sparse import csr_matrix n,m=list(map(int,input().split())) li=[[0 for i in range(n)] for j in range(n)] dmax=0 for k in range (m): s,t,d=list(map(int,input().split())) li[s-1][t-1]=d li[t-1][s-1]=d dmax=max(dmax,d) arl=np.array(li) for l in range(dmax): a=np.where(arl>=(dmax-l),1,0) sp,=dijkstra(csgraph=csr_matrix(a),indices=0) if sp[n-1]<=0: print(str(dmax-l)+" "+str(sp[n-1])) break