結果

問題 No.247 線形計画問題もどき
ユーザー tjaketjake
提出日時 2015-12-20 16:14:16
言語 PyPy2
(7.3.15)
結果
AC  
実行時間 113 ms / 2,000 ms
コード長 139 bytes
コンパイル時間 134 ms
コンパイル使用メモリ 77,560 KB
実行使用メモリ 80,044 KB
最終ジャッジ日時 2023-09-21 17:34:37
合計ジャッジ時間 3,664 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 82 ms
79,040 KB
testcase_01 AC 73 ms
77,600 KB
testcase_02 AC 113 ms
79,336 KB
testcase_03 AC 69 ms
76,292 KB
testcase_04 AC 69 ms
76,432 KB
testcase_05 AC 69 ms
76,360 KB
testcase_06 AC 70 ms
76,368 KB
testcase_07 AC 74 ms
79,172 KB
testcase_08 AC 73 ms
79,140 KB
testcase_09 AC 71 ms
76,436 KB
testcase_10 AC 72 ms
77,776 KB
testcase_11 AC 70 ms
76,632 KB
testcase_12 AC 71 ms
76,436 KB
testcase_13 AC 69 ms
76,364 KB
testcase_14 AC 70 ms
76,360 KB
testcase_15 AC 70 ms
76,404 KB
testcase_16 AC 68 ms
76,180 KB
testcase_17 AC 78 ms
79,176 KB
testcase_18 AC 76 ms
78,572 KB
testcase_19 AC 85 ms
79,328 KB
testcase_20 AC 101 ms
79,588 KB
testcase_21 AC 72 ms
77,420 KB
testcase_22 AC 76 ms
78,960 KB
testcase_23 AC 74 ms
78,776 KB
testcase_24 AC 99 ms
80,044 KB
testcase_25 AC 90 ms
79,332 KB
testcase_26 AC 78 ms
79,248 KB
testcase_27 AC 76 ms
79,316 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

c=input();input()
d=[0]+[c+1]*c
for e in map(int,raw_input().split()):
 for j in range(e,c+1):d[j]=min(d[j-e]+1,d[j])
print-(d[c]>c)or d[c]
0