結果

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

ソースコード

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
        break
    else:
        if N % 2 == 0:
            N = N / 2
        else:
            N = (N + 1) / 2
0