結果

問題 No.1861 Required Number
ユーザー 👑 rin204rin204
提出日時 2022-03-05 20:34:59
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 231 bytes
コンパイル時間 297 ms
コンパイル使用メモリ 86,788 KB
実行使用メモリ 268,376 KB
最終ジャッジ日時 2023-09-27 08:50:10
合計ジャッジ時間 8,344 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,608 KB
testcase_01 AC 70 ms
71,260 KB
testcase_02 AC 70 ms
71,384 KB
testcase_03 AC 81 ms
76,460 KB
testcase_04 AC 78 ms
76,344 KB
testcase_05 AC 71 ms
71,048 KB
testcase_06 AC 71 ms
71,208 KB
testcase_07 AC 71 ms
71,208 KB
testcase_08 AC 72 ms
71,188 KB
testcase_09 AC 73 ms
71,264 KB
testcase_10 AC 73 ms
71,060 KB
testcase_11 AC 73 ms
71,060 KB
testcase_12 AC 73 ms
71,268 KB
testcase_13 AC 73 ms
71,256 KB
testcase_14 AC 70 ms
71,096 KB
testcase_15 AC 72 ms
71,004 KB
testcase_16 AC 73 ms
71,052 KB
testcase_17 AC 70 ms
71,380 KB
testcase_18 AC 71 ms
71,288 KB
testcase_19 AC 73 ms
71,092 KB
testcase_20 AC 70 ms
70,848 KB
testcase_21 AC 72 ms
71,140 KB
testcase_22 AC 73 ms
71,296 KB
testcase_23 AC 71 ms
71,056 KB
testcase_24 AC 989 ms
260,044 KB
testcase_25 TLE -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
testcase_41 -- -
testcase_42 -- -
testcase_43 -- -
testcase_44 -- -
04_evil_1.txt -- -
04_evil_2.txt -- -
04_evil_3.txt -- -
04_evil_4.txt -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

n, k = map(int, input().split())
A = list(map(int, input().split()))
dp = 1
for a in A:
    dp |= dp << a

if not dp >> k & 1:
    print(-1)
    exit()

ans = 0
for a in A:
    if not dp >> (a + k) & 1:
        ans += 1
print(ans)
0