結果

問題 No.5 数字のブロック
ユーザー HIROPON87069639HIROPON87069639
提出日時 2016-02-27 16:55:16
言語 Python2
(2.7.18)
結果
WA  
実行時間 -
コード長 201 bytes
コンパイル時間 261 ms
コンパイル使用メモリ 7,124 KB
実行使用メモリ 7,300 KB
最終ジャッジ日時 2023-10-24 18:35:51
合計ジャッジ時間 1,711 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 12 ms
6,476 KB
testcase_01 AC 11 ms
6,476 KB
testcase_02 AC 12 ms
6,476 KB
testcase_03 AC 16 ms
6,820 KB
testcase_04 AC 14 ms
6,652 KB
testcase_05 AC 17 ms
7,112 KB
testcase_06 AC 16 ms
6,852 KB
testcase_07 AC 15 ms
6,716 KB
testcase_08 AC 16 ms
6,844 KB
testcase_09 AC 13 ms
6,632 KB
testcase_10 AC 18 ms
7,136 KB
testcase_11 AC 14 ms
6,704 KB
testcase_12 AC 16 ms
6,796 KB
testcase_13 AC 17 ms
7,104 KB
testcase_14 AC 11 ms
6,484 KB
testcase_15 AC 12 ms
6,492 KB
testcase_16 AC 18 ms
7,120 KB
testcase_17 AC 18 ms
7,180 KB
testcase_18 AC 18 ms
7,148 KB
testcase_19 AC 19 ms
7,300 KB
testcase_20 WA -
testcase_21 AC 12 ms
6,476 KB
testcase_22 AC 12 ms
6,476 KB
testcase_23 AC 11 ms
6,476 KB
testcase_24 AC 11 ms
6,496 KB
testcase_25 AC 12 ms
6,520 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 AC 14 ms
6,652 KB
testcase_30 AC 13 ms
6,636 KB
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

# -*- 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