結果

問題 No.5 数字のブロック
ユーザー hkawa117
提出日時 2015-09-05 21:17:06
言語 Python2
(2.7.18)
結果
OLE  
実行時間 -
コード長 258 bytes
コンパイル時間 207 ms
コンパイル使用メモリ 6,912 KB
実行使用メモリ 6,016 KB
最終ジャッジ日時 2024-07-19 04:11:21
合計ジャッジ時間 12,679 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other OLE * 1 -- * 33
権限があれば一括ダウンロードができます

ソースコード

diff #

L = int(raw_input())
N = int(raw_input())
W = tuple(sorted(map(int, raw_input().split())))

while True:
    tmp = sum(W[0:N-1])
    if tmp <= L:
        print N
    else:
        if N % 2 == 0:
            N = N / 2
        else:
            N = (N + 1) / 2
0