結果

問題 No.1701 half price
ユーザー harurunharurun
提出日時 2021-10-02 02:05:42
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 409 bytes
コンパイル時間 492 ms
コンパイル使用メモリ 86,760 KB
実行使用メモリ 77,208 KB
最終ジャッジ日時 2023-09-30 09:41:15
合計ジャッジ時間 4,591 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 66 ms
71,240 KB
testcase_01 AC 65 ms
76,096 KB
testcase_02 AC 109 ms
76,832 KB
testcase_03 AC 66 ms
75,856 KB
testcase_04 AC 111 ms
76,816 KB
testcase_05 AC 73 ms
76,396 KB
testcase_06 AC 558 ms
77,064 KB
testcase_07 AC 571 ms
77,100 KB
testcase_08 WA -
testcase_09 AC 69 ms
75,996 KB
testcase_10 AC 62 ms
71,408 KB
testcase_11 AC 64 ms
76,312 KB
testcase_12 AC 70 ms
76,248 KB
testcase_13 AC 66 ms
76,040 KB
testcase_14 AC 67 ms
76,396 KB
testcase_15 AC 65 ms
76,092 KB
testcase_16 AC 61 ms
71,168 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 63 ms
71,168 KB
testcase_21 AC 578 ms
76,792 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
  N,W=map(int,input().split())
  a=list(map(int,input().split()))
  ans=set()
  for i in range(pow(3,N)):
    s=0
    M=i
    l=[]
    for j in range(N):
      if M%3==1:
        s+=a[j]//2
        l.append(1)
      elif M%3==2:
        s+=a[j]
        l.append(1)
      else:
        l.append(0)
      M//=3
    if s==W:
      ans.add("".join(map(str,l)))
  print(len(ans))
  return    

main()

0