結果

問題 No.1701 half price
ユーザー harurunharurun
提出日時 2021-10-02 02:08:04
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 411 bytes
コンパイル時間 153 ms
コンパイル使用メモリ 10,916 KB
実行使用メモリ 8,532 KB
最終ジャッジ日時 2023-09-30 09:41:09
合計ジャッジ時間 13,481 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 13 ms
7,904 KB
testcase_01 AC 13 ms
7,796 KB
testcase_02 AC 320 ms
7,912 KB
testcase_03 AC 15 ms
7,800 KB
testcase_04 AC 333 ms
7,836 KB
testcase_05 AC 16 ms
7,912 KB
testcase_06 TLE -
testcase_07 TLE -
testcase_08 AC 14 ms
7,848 KB
testcase_09 AC 13 ms
7,844 KB
testcase_10 AC 12 ms
7,876 KB
testcase_11 AC 13 ms
7,864 KB
testcase_12 AC 13 ms
7,752 KB
testcase_13 AC 14 ms
7,820 KB
testcase_14 AC 14 ms
7,864 KB
testcase_15 AC 13 ms
7,872 KB
testcase_16 AC 13 ms
7,876 KB
testcase_17 AC 2,106 ms
8,532 KB
testcase_18 AC 19 ms
7,768 KB
testcase_19 AC 34 ms
7,820 KB
testcase_20 AC 16 ms
7,752 KB
testcase_21 TLE -
権限があれば一括ダウンロードができます

ソースコード

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