結果
| 問題 |
No.1701 half price
|
| コンテスト | |
| ユーザー |
lllllll88938494
|
| 提出日時 | 2022-09-12 20:47:46 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 569 bytes |
| コンパイル時間 | 154 ms |
| コンパイル使用メモリ | 82,304 KB |
| 実行使用メモリ | 76,416 KB |
| 最終ジャッジ日時 | 2024-11-29 21:58:31 |
| 合計ジャッジ時間 | 3,556 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 2 |
| other | AC * 6 WA * 14 |
ソースコード
from itertools import product
n,w=map(int,input().split())
a=list(map(int,input().split()))
ans=0
for i in product([0,1],repeat=n):
t=i.count(1)
if t == 0:
continue
for j in product([0,1],repeat=t):
indj=0
cntw=0
for k in range(n):
if i[k] == 1:
if j[indj] == 1:
cntw += a[k]//2
else:
cntw += a[k]
indj+=1
if cntw == w:
print(i,j)
ans+=1
break
print(ans)
lllllll88938494