結果
問題 | No.1701 half price |
ユーザー |
![]() |
提出日時 | 2021-10-08 23:44:27 |
言語 | Python3 (3.12.2 + numpy 1.26.4 + scipy 1.12.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 468 bytes |
コンパイル時間 | 2,045 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 17,700 KB |
最終ジャッジ日時 | 2024-07-23 08:10:27 |
合計ジャッジ時間 | 6,366 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 30 ms
17,700 KB |
testcase_01 | AC | 29 ms
10,624 KB |
testcase_02 | WA | - |
testcase_03 | WA | - |
testcase_04 | WA | - |
testcase_05 | WA | - |
testcase_06 | TLE | - |
testcase_07 | -- | - |
testcase_08 | -- | - |
testcase_09 | -- | - |
testcase_10 | -- | - |
testcase_11 | -- | - |
testcase_12 | -- | - |
testcase_13 | -- | - |
testcase_14 | -- | - |
testcase_15 | -- | - |
testcase_16 | -- | - |
testcase_17 | -- | - |
testcase_18 | -- | - |
testcase_19 | -- | - |
testcase_20 | -- | - |
testcase_21 | -- | - |
ソースコード
N,W = map(int,input().split()) A = list(map(int,input().split())) ans = 0 for b in range(1<<N): s = 0 for k in range(N): if b&(1<<k): s += A[k] if s== W: ans += 1 i = b while i>0: j = b - i s = 0 for k in range(N): if i&(1<<k): s += A[k] if j&(1<<k): s += A[k] // 2 i = (i-1) & b if s == W: ans += 1 print(ans)