結果

問題 No.5 数字のブロック
コンテスト
ユーザー HIROPON87069639
提出日時 2016-02-27 16:55:16
言語 PyPy2
(7.3.15)
結果
WA  
実行時間 -
コード長 201 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 131 ms
コンパイル使用メモリ 77,480 KB
最終ジャッジ日時 2025-12-03 19:33:32
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 27 WA * 7
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

# -*- coding: utf-8 -*-
L = input()
N = input()
W = map(int, raw_input().split())
W.sort()
tot = 0
cnt = 0
while tot < L and cnt < N:
    tot += W[cnt]
    cnt += 1
if L != tot:
    cnt -= 1
print cnt
0