結果

問題 No.914 Omiyage
ユーザー aaaaaaaaaa2230aaaaaaaaaa2230
提出日時 2022-04-26 23:32:20
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 84 ms / 2,000 ms
コード長 378 bytes
コンパイル時間 288 ms
コンパイル使用メモリ 87,016 KB
実行使用メモリ 76,144 KB
最終ジャッジ日時 2023-09-10 16:27:29
合計ジャッジ時間 3,000 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 80 ms
75,900 KB
testcase_01 AC 84 ms
75,880 KB
testcase_02 AC 79 ms
76,100 KB
testcase_03 AC 83 ms
76,144 KB
testcase_04 AC 80 ms
75,812 KB
testcase_05 AC 76 ms
71,284 KB
testcase_06 AC 75 ms
71,488 KB
testcase_07 AC 77 ms
71,132 KB
testcase_08 AC 75 ms
71,292 KB
testcase_09 AC 73 ms
71,176 KB
testcase_10 AC 79 ms
75,440 KB
testcase_11 AC 77 ms
75,520 KB
testcase_12 AC 82 ms
75,916 KB
testcase_13 AC 83 ms
75,860 KB
testcase_14 AC 84 ms
76,036 KB
testcase_15 AC 80 ms
75,704 KB
testcase_16 AC 76 ms
71,308 KB
testcase_17 AC 83 ms
76,112 KB
testcase_18 AC 77 ms
71,216 KB
testcase_19 AC 75 ms
71,312 KB
testcase_20 AC 76 ms
71,032 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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)
0