結果

問題 No.1701 half price
ユーザー harurun
提出日時 2021-10-02 02:08:04
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
TLE  
実行時間 -
コード長 411 bytes
コンパイル時間 367 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 16,384 KB
最終ジャッジ日時 2024-07-23 03:46:07
合計ジャッジ時間 5,898 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 4 TLE * 1 -- * 15
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
  N,W=map(int,input().split())
  a=list(map(int,input().split()))
  ans=set()
  for i in range(1,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