結果

問題 No.1861 Required Number
ユーザー 👑 rin204rin204
提出日時 2022-03-05 20:37:15
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 296 bytes
コンパイル時間 474 ms
コンパイル使用メモリ 87,116 KB
実行使用メモリ 163,360 KB
最終ジャッジ日時 2023-09-27 08:53:18
合計ジャッジ時間 22,011 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
163,360 KB
testcase_01 AC 74 ms
80,372 KB
testcase_02 AC 73 ms
75,924 KB
testcase_03 AC 242 ms
81,360 KB
testcase_04 AC 240 ms
81,352 KB
testcase_05 AC 71 ms
78,636 KB
testcase_06 AC 71 ms
71,488 KB
testcase_07 AC 75 ms
76,004 KB
testcase_08 AC 76 ms
75,840 KB
testcase_09 AC 74 ms
75,860 KB
testcase_10 AC 73 ms
76,164 KB
testcase_11 AC 76 ms
76,164 KB
testcase_12 AC 75 ms
75,976 KB
testcase_13 AC 74 ms
76,052 KB
testcase_14 AC 74 ms
76,168 KB
testcase_15 AC 75 ms
76,168 KB
testcase_16 AC 74 ms
75,984 KB
testcase_17 AC 78 ms
76,108 KB
testcase_18 AC 76 ms
76,156 KB
testcase_19 AC 77 ms
76,268 KB
testcase_20 AC 79 ms
76,100 KB
testcase_21 AC 76 ms
76,172 KB
testcase_22 AC 77 ms
76,208 KB
testcase_23 AC 74 ms
76,172 KB
testcase_24 AC 142 ms
76,848 KB
testcase_25 AC 238 ms
76,956 KB
testcase_26 AC 104 ms
76,720 KB
testcase_27 AC 132 ms
76,732 KB
testcase_28 AC 142 ms
76,760 KB
testcase_29 AC 115 ms
76,660 KB
testcase_30 AC 80 ms
76,756 KB
testcase_31 AC 229 ms
76,848 KB
testcase_32 AC 84 ms
76,844 KB
testcase_33 AC 183 ms
76,948 KB
testcase_34 AC 207 ms
76,836 KB
testcase_35 AC 210 ms
76,752 KB
testcase_36 AC 118 ms
76,736 KB
testcase_37 AC 141 ms
76,840 KB
testcase_38 AC 205 ms
76,848 KB
testcase_39 AC 151 ms
76,864 KB
testcase_40 AC 229 ms
76,864 KB
testcase_41 AC 221 ms
76,948 KB
testcase_42 AC 200 ms
76,872 KB
testcase_43 AC 143 ms
76,804 KB
testcase_44 WA -
04_evil_1.txt TLE -
04_evil_2.txt TLE -
04_evil_3.txt TLE -
04_evil_4.txt TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

n, k = map(int, input().split())
A = list(map(int, input().split()))
dp = [False] * (2 * k + 1)
dp[0] = True

for a in A:
    for i in range(2 * k, a - 1, -1):
        dp[i] |= dp[i - a]

if not dp[k]:
    print(-1)
    exit()
ans = 0
for a in A:
    if not dp[a + k]:
        ans += 1
print(ans)
0