結果

問題 No.5 数字のブロック
ユーザー R NR N
提出日時 2020-07-22 18:41:04
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 38 ms / 5,000 ms
コード長 427 bytes
コンパイル時間 306 ms
コンパイル使用メモリ 10,644 KB
実行使用メモリ 11,304 KB
最終ジャッジ日時 2023-09-03 18:22:24
合計ジャッジ時間 3,902 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
10,360 KB
testcase_01 AC 33 ms
10,168 KB
testcase_02 AC 33 ms
10,188 KB
testcase_03 AC 35 ms
10,864 KB
testcase_04 AC 34 ms
10,604 KB
testcase_05 AC 36 ms
11,204 KB
testcase_06 AC 34 ms
10,760 KB
testcase_07 AC 34 ms
10,672 KB
testcase_08 AC 35 ms
11,012 KB
testcase_09 AC 33 ms
10,596 KB
testcase_10 AC 36 ms
11,276 KB
testcase_11 AC 33 ms
10,812 KB
testcase_12 AC 35 ms
11,112 KB
testcase_13 AC 36 ms
11,224 KB
testcase_14 AC 32 ms
10,292 KB
testcase_15 AC 32 ms
10,384 KB
testcase_16 AC 36 ms
11,224 KB
testcase_17 AC 37 ms
11,296 KB
testcase_18 AC 37 ms
11,160 KB
testcase_19 AC 38 ms
11,304 KB
testcase_20 AC 33 ms
10,392 KB
testcase_21 AC 33 ms
10,220 KB
testcase_22 AC 33 ms
10,164 KB
testcase_23 AC 31 ms
10,184 KB
testcase_24 AC 32 ms
10,252 KB
testcase_25 AC 33 ms
10,212 KB
testcase_26 AC 32 ms
10,224 KB
testcase_27 AC 31 ms
10,196 KB
testcase_28 AC 32 ms
10,328 KB
testcase_29 AC 35 ms
10,788 KB
testcase_30 AC 34 ms
10,392 KB
testcase_31 AC 33 ms
10,344 KB
testcase_32 AC 33 ms
10,148 KB
testcase_33 AC 33 ms
10,152 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# coding:utf-8
import statistics
hako_L = int(input())
block_num = int(input())
block_list = list(map(int, input().split()))
block_list = sorted(block_list)

list_center = statistics.median(block_list)
a = 0
i = 0
c = 0
while True:
    try:
        c += 1
        a += block_list[i]
        i += 1
        if a > hako_L:
            break
        else:
            continue
    except IndexError:
            break
print(c - 1)
0