結果
問題 |
No.1463 Hungry Kanten
|
ユーザー |
![]() |
提出日時 | 2021-04-02 21:30:32 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 347 ms / 2,000 ms |
コード長 | 384 bytes |
コンパイル時間 | 207 ms |
コンパイル使用メモリ | 82,236 KB |
実行使用メモリ | 112,536 KB |
最終ジャッジ日時 | 2025-06-20 01:30:48 |
合計ジャッジ時間 | 3,568 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 24 |
ソースコード
from sys import stdin S = set() N,K = map(int,stdin.readline().split()) A = list(map(int,stdin.readline().split())) for i in range(2**N): ss = 0 mm = 1 popcnt = 0 for j in range(N): if 2**j & i > 0: popcnt += 1 ss += A[j] mm *= A[j] if popcnt >= K: S.add(ss) S.add(mm) #print (S) print (len(S))