結果

問題 No.5 数字のブロック
ユーザー 夕日夕日
提出日時 2021-06-24 16:48:26
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 86 ms / 5,000 ms
コード長 238 bytes
コンパイル時間 302 ms
コンパイル使用メモリ 87,144 KB
実行使用メモリ 75,732 KB
最終ジャッジ日時 2023-09-07 13:25:02
合計ジャッジ時間 4,414 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
71,184 KB
testcase_01 AC 75 ms
71,084 KB
testcase_02 AC 76 ms
71,284 KB
testcase_03 AC 85 ms
75,348 KB
testcase_04 AC 80 ms
75,500 KB
testcase_05 AC 84 ms
75,392 KB
testcase_06 AC 81 ms
75,384 KB
testcase_07 AC 80 ms
75,384 KB
testcase_08 AC 82 ms
75,392 KB
testcase_09 AC 80 ms
75,732 KB
testcase_10 AC 84 ms
75,496 KB
testcase_11 AC 81 ms
75,348 KB
testcase_12 AC 82 ms
75,484 KB
testcase_13 AC 83 ms
75,484 KB
testcase_14 AC 74 ms
71,452 KB
testcase_15 AC 75 ms
71,368 KB
testcase_16 AC 82 ms
75,492 KB
testcase_17 AC 84 ms
75,504 KB
testcase_18 AC 83 ms
75,536 KB
testcase_19 AC 86 ms
75,628 KB
testcase_20 AC 75 ms
71,324 KB
testcase_21 AC 76 ms
71,492 KB
testcase_22 AC 76 ms
71,232 KB
testcase_23 AC 75 ms
71,488 KB
testcase_24 AC 74 ms
71,332 KB
testcase_25 AC 76 ms
71,472 KB
testcase_26 AC 75 ms
71,324 KB
testcase_27 AC 75 ms
71,156 KB
testcase_28 AC 76 ms
71,328 KB
testcase_29 AC 81 ms
75,632 KB
testcase_30 AC 80 ms
75,624 KB
testcase_31 AC 75 ms
71,216 KB
testcase_32 AC 74 ms
71,332 KB
testcase_33 AC 74 ms
71,144 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

L=int(input())
N=int(input())
W = input().split()
W.sort(key=int)
for i in range(N):
    if L >= int(W[i]):
        L -= int(W[i])
        if N == i+1:
            print(i+1)
            break
    
    else:
        print(i)
        break
0