結果

問題 No.1463 Hungry Kanten
ユーザー googol_S0googol_S0
提出日時 2021-04-02 21:47:43
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 459 ms / 2,000 ms
コード長 290 bytes
コンパイル時間 909 ms
コンパイル使用メモリ 86,748 KB
実行使用メモリ 126,668 KB
最終ジャッジ日時 2023-08-25 14:55:51
合計ジャッジ時間 4,419 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,208 KB
testcase_01 AC 68 ms
71,460 KB
testcase_02 AC 106 ms
78,328 KB
testcase_03 AC 366 ms
77,360 KB
testcase_04 AC 74 ms
76,308 KB
testcase_05 AC 459 ms
126,668 KB
testcase_06 AC 66 ms
71,332 KB
testcase_07 AC 67 ms
71,164 KB
testcase_08 AC 67 ms
71,276 KB
testcase_09 AC 68 ms
71,324 KB
testcase_10 AC 73 ms
76,280 KB
testcase_11 AC 81 ms
76,676 KB
testcase_12 AC 84 ms
76,988 KB
testcase_13 AC 80 ms
76,284 KB
testcase_14 AC 92 ms
76,700 KB
testcase_15 AC 88 ms
77,060 KB
testcase_16 AC 101 ms
78,288 KB
testcase_17 AC 133 ms
81,264 KB
testcase_18 AC 122 ms
77,784 KB
testcase_19 AC 272 ms
96,300 KB
testcase_20 AC 366 ms
105,696 KB
testcase_21 AC 81 ms
76,900 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,K=map(int,input().split())
A=list(map(int,input().split()))
S=set()
for i in range(1<<N):
  if bin(i).count('1')>=K:
    x=0
    for j in range(N):
      if i&(1<<j):
        x+=A[j]
    S.add(x)
    x=1
    for j in range(N):
      if i&(1<<j):
        x*=A[j]
    S.add(x)
print(len(S))
0