結果
| 問題 |
No.914 Omiyage
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-09-13 02:57:43 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 49 ms / 2,000 ms |
| コード長 | 297 bytes |
| コンパイル時間 | 331 ms |
| コンパイル使用メモリ | 82,384 KB |
| 実行使用メモリ | 62,492 KB |
| 最終ジャッジ日時 | 2025-01-02 16:33:59 |
| 合計ジャッジ時間 | 2,183 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 18 |
ソースコード
N, M, K = map(int, input().split())
DP = [0] * K + [1]
for i in range(N):
dp = [0] * (K + 1)
for a in map(int, input().split()):
for i in range(K):
if i + a <= K and DP[i + a]:
dp[i] = 1
DP = dp
try:
print(DP.index(1))
except:
print(-1)