結果

問題 No.1463 Hungry Kanten
ユーザー yuusanlondonyuusanlondon
提出日時 2021-04-02 21:41:58
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 323 ms / 2,000 ms
コード長 238 bytes
コンパイル時間 596 ms
コンパイル使用メモリ 81,792 KB
実行使用メモリ 123,752 KB
最終ジャッジ日時 2024-12-23 23:25:00
合計ジャッジ時間 2,793 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

n,k=map(int,input().split())
a=list(map(int,input().split()))
p=set()
for i in range(1<<n):
  q=[]
  l=1
  for j in range(n):
    if i&(1<<j):
      q.append(a[j])
      l*=a[j]
  if len(q)>=k:
    p.add(sum(q))
    p.add(l)
print(len(p))
0