結果

問題 No.1463 Hungry Kanten
ユーザー 河野竜也河野竜也
提出日時 2022-06-20 23:00:40
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,624 ms / 2,000 ms
コード長 271 bytes
コンパイル時間 181 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 31,180 KB
最終ジャッジ日時 2024-04-21 13:18:52
合計ジャッジ時間 7,841 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 26 ms
10,752 KB
testcase_01 AC 28 ms
10,752 KB
testcase_02 AC 109 ms
11,648 KB
testcase_03 AC 1,601 ms
10,752 KB
testcase_04 AC 32 ms
10,752 KB
testcase_05 AC 1,624 ms
31,180 KB
testcase_06 AC 26 ms
10,752 KB
testcase_07 AC 26 ms
10,880 KB
testcase_08 AC 25 ms
10,752 KB
testcase_09 AC 25 ms
10,752 KB
testcase_10 AC 25 ms
10,752 KB
testcase_11 AC 25 ms
10,880 KB
testcase_12 AC 28 ms
10,880 KB
testcase_13 AC 32 ms
10,752 KB
testcase_14 AC 40 ms
11,008 KB
testcase_15 AC 60 ms
10,880 KB
testcase_16 AC 99 ms
11,776 KB
testcase_17 AC 194 ms
13,952 KB
testcase_18 AC 360 ms
11,520 KB
testcase_19 AC 760 ms
20,796 KB
testcase_20 AC 1,624 ms
30,172 KB
testcase_21 AC 27 ms
10,752 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,k=map(int,input().split())
a=list(map(int,input().split()))
s=set()
for bit in range(1<<n):
  ans1=0
  ans2=1
  count=0
  for i in range(n):
    if bit&(1<<i):
      ans1+=a[i]
      ans2*=a[i]
      count+=1
  if count>=k:
    s.add(ans1)
    s.add(ans2)
print(len(s))
0