結果

問題 No.5 数字のブロック
ユーザー Cyberdog-しばいぬ-Cyberdog-しばいぬ-
提出日時 2019-02-04 09:56:41
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 252 bytes
コンパイル時間 343 ms
コンパイル使用メモリ 10,628 KB
実行使用メモリ 9,276 KB
最終ジャッジ日時 2023-08-25 22:01:10
合計ジャッジ時間 2,753 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
8,088 KB
testcase_01 AC 15 ms
8,072 KB
testcase_02 AC 14 ms
8,048 KB
testcase_03 AC 17 ms
8,840 KB
testcase_04 AC 17 ms
8,644 KB
testcase_05 AC 19 ms
8,920 KB
testcase_06 AC 17 ms
8,708 KB
testcase_07 AC 17 ms
8,732 KB
testcase_08 AC 18 ms
8,704 KB
testcase_09 AC 17 ms
8,308 KB
testcase_10 AC 19 ms
9,116 KB
testcase_11 AC 16 ms
8,648 KB
testcase_12 AC 17 ms
8,832 KB
testcase_13 AC 18 ms
8,892 KB
testcase_14 AC 15 ms
8,084 KB
testcase_15 AC 15 ms
8,084 KB
testcase_16 AC 18 ms
9,068 KB
testcase_17 AC 19 ms
9,100 KB
testcase_18 AC 19 ms
9,200 KB
testcase_19 AC 20 ms
9,276 KB
testcase_20 WA -
testcase_21 AC 15 ms
8,072 KB
testcase_22 AC 15 ms
8,120 KB
testcase_23 AC 15 ms
8,044 KB
testcase_24 AC 15 ms
8,240 KB
testcase_25 AC 15 ms
8,252 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 AC 18 ms
8,484 KB
testcase_30 AC 16 ms
8,404 KB
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

width = int(input())
N = int(input())
bl = list(map(int, input().split()))
bl.sort()
bs = 0
if sum(bl) == width:
    print(len(bl))
    exit()
for i in range(N):
    if bs + bl[i] <= width:
        bs += bl[i]
    else:
        print(i)
        exit()
0