結果
問題 | No.1463 Hungry Kanten |
ユーザー |
![]() |
提出日時 | 2024-02-06 11:44:41 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 301 ms / 2,000 ms |
コード長 | 422 bytes |
コンパイル時間 | 180 ms |
コンパイル使用メモリ | 81,920 KB |
実行使用メモリ | 120,756 KB |
最終ジャッジ日時 | 2024-09-28 11:59:01 |
合計ジャッジ時間 | 2,686 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 20 |
ソースコード
N,K = map(int,input().split())A = list(map(int,input().split()))ans = set()def popcnt(x):res = 0while x:res += (x & 1)x >>= 1return resfor s in range(1 << N):if popcnt(s) < K:continueplus = 0mul = 1for i in range(N):if (s >> i) & 1:plus += A[i]mul *= A[i]ans.add(plus)ans.add(mul)print(len(ans))