結果
問題 |
No.1701 half price
|
ユーザー |
![]() |
提出日時 | 2022-12-31 19:28:15 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 476 bytes |
コンパイル時間 | 162 ms |
コンパイル使用メモリ | 82,432 KB |
実行使用メモリ | 75,904 KB |
最終ジャッジ日時 | 2024-11-26 18:35:22 |
合計ジャッジ時間 | 2,920 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 16 WA * 4 |
ソースコード
N, W = map(int, input().split()) A = list(map(int, input().split())) ans = 0 for i in range(1 << N): flag = 0 cnt = 0 for j in range(N): if (i >> j) & 1: cnt += A[j] if cnt == W: flag = 1 sub = i while sub: temp = W for j in range(N): if (sub >> j) & 1: temp += A[j]//2 if cnt == temp: flag = 1 sub = i & (sub - 1) ans += flag print(ans)