結果

問題 No.5 数字のブロック
ユーザー pea vavapea vava
提出日時 2020-08-30 11:13:42
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 463 bytes
コンパイル時間 416 ms
コンパイル使用メモリ 10,624 KB
実行使用メモリ 9,320 KB
最終ジャッジ日時 2023-08-09 11:00:24
合計ジャッジ時間 2,834 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,804 KB
testcase_01 AC 16 ms
7,984 KB
testcase_02 AC 16 ms
7,840 KB
testcase_03 AC 19 ms
8,872 KB
testcase_04 WA -
testcase_05 AC 21 ms
8,988 KB
testcase_06 WA -
testcase_07 AC 18 ms
8,644 KB
testcase_08 AC 19 ms
8,732 KB
testcase_09 AC 17 ms
8,372 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 19 ms
8,844 KB
testcase_13 AC 19 ms
8,984 KB
testcase_14 AC 15 ms
7,860 KB
testcase_15 AC 15 ms
7,936 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 22 ms
9,320 KB
testcase_20 AC 16 ms
7,984 KB
testcase_21 AC 16 ms
7,804 KB
testcase_22 AC 16 ms
7,804 KB
testcase_23 AC 16 ms
7,828 KB
testcase_24 AC 16 ms
7,940 KB
testcase_25 AC 16 ms
7,988 KB
testcase_26 AC 15 ms
7,824 KB
testcase_27 AC 16 ms
7,976 KB
testcase_28 AC 15 ms
7,884 KB
testcase_29 WA -
testcase_30 WA -
testcase_31 AC 16 ms
7,792 KB
testcase_32 AC 15 ms
7,852 KB
testcase_33 AC 16 ms
7,936 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

L = int(input()) #箱のサイズ
N = int(input()) #ブロックの個数
W_list = list(map(int, input().split())) #ブロックの幅サイズ
W_list.sort()
#print(W_list) #W_listソート後の表示

sum = 0
for i in W_list:
    sum = sum + i
#print(sum) #W_listの合計の表示
if sum <= L:
    print(N)
elif sum > L:
    sum = 0
    for j in W_list:
        sum = sum + j
        if sum > L:
            break
    print(W_list.index(j))
0