結果
問題 | No.1701 half price |
ユーザー | lllllll88938494 |
提出日時 | 2022-09-12 20:47:48 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 569 bytes |
コンパイル時間 | 394 ms |
コンパイル使用メモリ | 87,252 KB |
実行使用メモリ | 77,688 KB |
最終ジャッジ日時 | 2023-08-19 23:56:50 |
合計ジャッジ時間 | 4,897 ms |
ジャッジサーバーID (参考情報) |
judge12 / judge15 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | WA | - |
testcase_01 | WA | - |
testcase_02 | WA | - |
testcase_03 | WA | - |
testcase_04 | WA | - |
testcase_05 | WA | - |
testcase_06 | WA | - |
testcase_07 | WA | - |
testcase_08 | WA | - |
testcase_09 | AC | 72 ms
76,292 KB |
testcase_10 | AC | 71 ms
71,324 KB |
testcase_11 | WA | - |
testcase_12 | WA | - |
testcase_13 | WA | - |
testcase_14 | WA | - |
testcase_15 | AC | 72 ms
76,296 KB |
testcase_16 | AC | 68 ms
71,384 KB |
testcase_17 | WA | - |
testcase_18 | WA | - |
testcase_19 | WA | - |
testcase_20 | AC | 68 ms
71,376 KB |
testcase_21 | AC | 614 ms
77,264 KB |
ソースコード
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)