結果

問題 No.914 Omiyage
ユーザー 👑 rin204rin204
提出日時 2022-02-12 22:27:11
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 84 ms / 2,000 ms
コード長 389 bytes
コンパイル時間 351 ms
コンパイル使用メモリ 86,940 KB
実行使用メモリ 76,168 KB
最終ジャッジ日時 2023-09-11 10:59:41
合計ジャッジ時間 3,707 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 84 ms
75,912 KB
testcase_01 AC 83 ms
75,916 KB
testcase_02 AC 80 ms
76,020 KB
testcase_03 AC 82 ms
75,928 KB
testcase_04 AC 80 ms
76,028 KB
testcase_05 AC 75 ms
71,244 KB
testcase_06 AC 76 ms
71,360 KB
testcase_07 AC 74 ms
71,248 KB
testcase_08 AC 74 ms
71,268 KB
testcase_09 AC 75 ms
71,368 KB
testcase_10 AC 82 ms
75,932 KB
testcase_11 AC 81 ms
75,932 KB
testcase_12 AC 83 ms
76,088 KB
testcase_13 AC 82 ms
75,856 KB
testcase_14 AC 81 ms
76,060 KB
testcase_15 AC 80 ms
75,956 KB
testcase_16 AC 79 ms
75,952 KB
testcase_17 AC 80 ms
76,168 KB
testcase_18 AC 74 ms
71,336 KB
testcase_19 AC 75 ms
71,224 KB
testcase_20 AC 74 ms
71,616 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, m, k = map(int, input().split())
dp = [[False] * (k + 1) for _ in range(n + 1)]
dp[0][k] = True
for i in range(1, n + 1):
    A = list(map(int, input().split()))
    for a in A:
        for j in range(k - a + 1):
            if dp[i - 1][j + a]:
                dp[i][j] = True
                
for j in range(k + 1):
    if dp[-1][j]:
        print(j)
        break
else:
    print(-1)
0