結果
問題 |
No.5 数字のブロック
|
ユーザー |
![]() |
提出日時 | 2019-08-18 03:24:38 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
TLE
|
実行時間 | - |
コード長 | 379 bytes |
コンパイル時間 | 97 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 18,208 KB |
最終ジャッジ日時 | 2024-10-01 07:00:04 |
合計ジャッジ時間 | 6,695 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 3 TLE * 1 -- * 30 |
ソースコード
l = int(input()) n = int(input()) w = [int(i) for i in input().split()] max_num = 0 r_num = 2**n for i in range(1,r_num+1): s = bin(i)[2:].zfill(n) k_num = 0 pr_num = 0 for j, f_num in zip(list(s), range(n)): if j == "1": k_num += w[f_num] pr_num += 1 if k_num <= l and max_num < pr_num: max_num = pr_num print(max_num)