結果
問題 |
No.1 道のショートカット
|
ユーザー |
![]() |
提出日時 | 2016-04-26 11:57:54 |
言語 | Python2 (2.7.18) |
結果 |
MLE
|
実行時間 | - |
コード長 | 480 bytes |
コンパイル時間 | 76 ms |
コンパイル使用メモリ | 6,912 KB |
実行使用メモリ | 606,876 KB |
最終ジャッジ日時 | 2024-07-08 04:27:11 |
合計ジャッジ時間 | 7,376 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 7 MLE * 1 -- * 32 |
ソースコード
n = int(raw_input()) c = int(raw_input()) v = int(raw_input()) s = map(int, raw_input().split()) t = map(int, raw_input().split()) y = map(int, raw_input().split()) m = map(int, raw_input().split()) a = [[] for _ in range(n)] b = sorted([[s[i]-1,t[i]-1,y[i],m[i]] for i in range(v)]) a[0].append([c,0]) for bi in b: for ai in a[bi[0]]: if ai[0]-bi[2] >= 0: a[bi[1]].append([ai[0]-bi[2],ai[1]+bi[3]]) ans = -1 if a[-1]: ans = sorted(a[-1],key=lambda x:x[1])[0][1] print ans