結果
問題 |
No.1473 おでぶなおばけさん
|
ユーザー |
|
提出日時 | 2022-10-07 11:23:32 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
RE
|
実行時間 | - |
コード長 | 534 bytes |
コンパイル時間 | 234 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 386,644 KB |
最終ジャッジ日時 | 2024-06-11 19:11:25 |
合計ジャッジ時間 | 8,065 ms |
ジャッジサーバーID (参考情報) |
judge4 / 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),directed=False,indices=0,unweighted=True) if sp[n-1]<=0: print(str(dmax-l)+" "+str(sp[n-1])) break