結果
問題 | No.2712 Play more! |
ユーザー |
![]() |
提出日時 | 2024-04-05 14:37:06 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 299 bytes |
コンパイル時間 | 236 ms |
コンパイル使用メモリ | 82,432 KB |
実行使用メモリ | 78,396 KB |
最終ジャッジ日時 | 2024-10-01 01:07:33 |
合計ジャッジ時間 | 6,956 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 31 WA * 2 |
ソースコード
n,m=map(int,input().split())a=list(map(int,input().split()))e=[]for i in range(m):x,y,z=map(int,input().split())e+=[(x-1,y-1,z-a[x-1])]X=10**20v=[X]*nv[0]=0for i in range(n+1):f=0for x,y,z in e:if v[y]>v[x]+z:v[y]=v[x]+zf=1print("inf" if f else -v[n-1]+a[n-1])