結果
| 問題 | No.1463 Hungry Kanten | 
| コンテスト | |
| ユーザー |  🍮かんプリン | 
| 提出日時 | 2021-04-02 22:35:05 | 
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) | 
| 結果 | 
                                TLE
                                 
                            (最新) 
                                AC
                                 
                            (最初) | 
| 実行時間 | - | 
| コード長 | 374 bytes | 
| コンパイル時間 | 139 ms | 
| コンパイル使用メモリ | 12,672 KB | 
| 実行使用メモリ | 47,852 KB | 
| 最終ジャッジ日時 | 2024-12-23 23:39:25 | 
| 合計ジャッジ時間 | 9,462 ms | 
| ジャッジサーバーID (参考情報) | judge2 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 | 
| other | AC * 18 TLE * 2 | 
ソースコード
def bpc(n):
    ans = 0
    while n:
        if n & 1: ans += 1
        n >>= 1
    return ans
n,k = map(int,input().split())
a = list(map(int,input().split()))
s = []
for i in range(1<<n):
    if bpc(i) < k: continue
    sum = 0
    mul = 1
    for j in range(n):
        if i & (1<<j):
            sum += a[j]
            mul *= a[j]
    s += [sum,mul]
print(len(set(s)))
            
            
            
        