結果
問題 | No.1861 Required Number |
ユーザー | brthyyjp |
提出日時 | 2022-03-06 14:10:04 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 427 bytes |
コンパイル時間 | 863 ms |
コンパイル使用メモリ | 86,984 KB |
実行使用メモリ | 264,328 KB |
最終ジャッジ日時 | 2023-09-28 05:08:26 |
合計ジャッジ時間 | 11,339 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge15 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 90 ms
76,032 KB |
testcase_01 | AC | 90 ms
71,388 KB |
testcase_02 | AC | 93 ms
71,844 KB |
testcase_03 | WA | - |
testcase_04 | WA | - |
testcase_05 | AC | 90 ms
71,696 KB |
testcase_06 | WA | - |
testcase_07 | WA | - |
testcase_08 | AC | 101 ms
76,796 KB |
testcase_09 | AC | 92 ms
71,644 KB |
testcase_10 | WA | - |
testcase_11 | WA | - |
testcase_12 | AC | 93 ms
71,696 KB |
testcase_13 | WA | - |
testcase_14 | WA | - |
testcase_15 | WA | - |
testcase_16 | AC | 89 ms
71,524 KB |
testcase_17 | WA | - |
testcase_18 | WA | - |
testcase_19 | WA | - |
testcase_20 | WA | - |
testcase_21 | WA | - |
testcase_22 | WA | - |
testcase_23 | WA | - |
testcase_24 | TLE | - |
testcase_25 | -- | - |
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 | -- | - |
ソースコード
n, k = map(int, input().split()) A = list(map(int, input().split())) from collections import Counter C = Counter(A) limit = (1<<k)-1 ans = 0 for a, v in C.items(): dp = 1 for b, u in C.items(): if a == b: continue for i in range(u): dp |= dp<<b if (dp>>k)&1: continue if (dp>>(k-a))&1 and v == 1: ans += 1 if ans != 0: print(ans) else: print(-1)