結果

問題 No.1463 Hungry Kanten
ユーザー yuusanlondonyuusanlondon
提出日時 2021-04-02 21:41:58
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 378 ms / 2,000 ms
コード長 238 bytes
コンパイル時間 275 ms
コンパイル使用メモリ 87,268 KB
実行使用メモリ 128,096 KB
最終ジャッジ日時 2023-08-25 14:52:16
合計ジャッジ時間 4,003 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,064 KB
testcase_01 AC 69 ms
71,280 KB
testcase_02 AC 97 ms
78,096 KB
testcase_03 AC 263 ms
77,140 KB
testcase_04 AC 84 ms
76,232 KB
testcase_05 AC 378 ms
128,096 KB
testcase_06 AC 70 ms
71,184 KB
testcase_07 AC 70 ms
71,244 KB
testcase_08 AC 71 ms
71,012 KB
testcase_09 AC 71 ms
70,908 KB
testcase_10 AC 77 ms
76,204 KB
testcase_11 AC 82 ms
76,044 KB
testcase_12 AC 89 ms
76,472 KB
testcase_13 AC 88 ms
76,540 KB
testcase_14 AC 91 ms
76,640 KB
testcase_15 AC 94 ms
76,628 KB
testcase_16 AC 100 ms
78,364 KB
testcase_17 AC 119 ms
80,556 KB
testcase_18 AC 116 ms
78,164 KB
testcase_19 AC 218 ms
95,444 KB
testcase_20 AC 305 ms
106,640 KB
testcase_21 AC 81 ms
76,568 KB
権限があれば一括ダウンロードができます

ソースコード

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