結果
問題 |
No.1701 half price
|
ユーザー |
![]() |
提出日時 | 2021-10-10 10:39:30 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 662 bytes |
コンパイル時間 | 369 ms |
コンパイル使用メモリ | 82,212 KB |
実行使用メモリ | 76,672 KB |
最終ジャッジ日時 | 2024-09-14 04:56:08 |
合計ジャッジ時間 | 4,760 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 16 WA * 4 |
ソースコード
import sys input = sys.stdin.readline #input = sys.stdin.buffer.readline import itertools def main(): N,W = map(int,input().split()) A = list(map(int,input().split())) sgn = [0,1,2] ans = set([]) for L in itertools.product(sgn,repeat=N): temp = 0 used = [] for i,x in enumerate(L): if x == 1: temp += A[i] used.append(i) if x == 2: temp += A[i]//2 used.append(i) if temp == W: used.sort() tused = tuple(used) ans.add(tused) print(len(ans)) if __name__ == '__main__': main()