結果

問題 No.1463 Hungry Kanten
コンテスト
ユーザー kept1994
提出日時 2021-09-01 00:06:50
言語 PyPy3
(8.0.0 + ACL)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 151 ms / 2,000 ms
+ 949µs
コード長 494 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 313 ms
コンパイル使用メモリ 64,632 KB
実行使用メモリ 95,712 KB
最終ジャッジ日時 2026-10-15 12:24:12
合計ジャッジ時間 3,555 ms
ジャッジサーバーID
(参考情報)
judge5_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#!/usr/bin/env python3
import sys

def main():
    from itertools import combinations
    N, K = map(int,input().split())
    A = list(map(int, input().split()))
    res = set()
    for kk in range(K, N + 1):
        for p in combinations(A, kk):
            sum = 0
            mul = 1
            for i in p:
                sum += i
                mul *= i
            res.add(sum)
            res.add(mul)
    # print(res)
    print(len(res))
        
if __name__ == '__main__':
    main()
0