結果
問題 | No.914 Omiyage |
ユーザー |
|
提出日時 | 2022-04-26 23:32:20 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 51 ms / 2,000 ms |
コード長 | 378 bytes |
コンパイル時間 | 160 ms |
コンパイル使用メモリ | 82,048 KB |
実行使用メモリ | 59,904 KB |
最終ジャッジ日時 | 2024-06-28 07:32:00 |
合計ジャッジ時間 | 1,850 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 18 |
ソースコード
n,m,k = map(int,input().split()) A = [list(map(int,input().split())) for i in range(n)] dp = [0]*(k+1) dp[k] = 1 for a in A: ndp = [0]*(k+1) for i in range(k+1): if dp[i] == 0: continue for j in a: if i-j >= 0: ndp[i-j] = 1 dp = ndp for i in range(k+1): if dp[i]: print(i) exit() print(-1)