結果
問題 |
No.1 道のショートカット
|
ユーザー |
![]() |
提出日時 | 2016-04-12 17:03:52 |
言語 | Python2 (2.7.18) |
結果 |
TLE
|
実行時間 | - |
コード長 | 359 bytes |
コンパイル時間 | 169 ms |
コンパイル使用メモリ | 7,068 KB |
実行使用メモリ | 92,828 KB |
最終ジャッジ日時 | 2024-07-08 04:26:35 |
合計ジャッジ時間 | 10,476 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 7 TLE * 1 -- * 32 |
ソースコード
l=lambda:map(int,raw_input().split()) n=input() c=input() v=input() s=l() t=l() y=l() m=l() r=[(0,0,[1])] g=[] while len(r)>0: a=r.pop(0) for i in [i for i in range(v)if s[i]==a[2][-1]]: b=(a[0]+y[i],a[1]+m[i],a[2]+[t[i]]) if b[0]<=c: if b[2][-1]==n: g+=[b] else: r+=[b] if len(g)>0: a=min(g,key=lambda x:x[1]) print a[1] else: print -1