結果

問題 No.5 数字のブロック
ユーザー shakayamishakayami
提出日時 2022-12-23 14:53:15
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 75 ms / 5,000 ms
コード長 188 bytes
コンパイル時間 479 ms
コンパイル使用メモリ 86,676 KB
実行使用メモリ 75,996 KB
最終ジャッジ日時 2023-08-11 11:50:52
合計ジャッジ時間 4,751 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 68 ms
71,200 KB
testcase_01 AC 68 ms
71,380 KB
testcase_02 AC 67 ms
71,088 KB
testcase_03 AC 75 ms
75,916 KB
testcase_04 AC 75 ms
75,860 KB
testcase_05 AC 72 ms
75,920 KB
testcase_06 AC 73 ms
75,716 KB
testcase_07 AC 73 ms
75,996 KB
testcase_08 AC 69 ms
75,924 KB
testcase_09 AC 72 ms
75,720 KB
testcase_10 AC 75 ms
75,624 KB
testcase_11 AC 74 ms
75,716 KB
testcase_12 AC 73 ms
75,584 KB
testcase_13 AC 74 ms
75,656 KB
testcase_14 AC 70 ms
71,096 KB
testcase_15 AC 69 ms
71,184 KB
testcase_16 AC 74 ms
75,652 KB
testcase_17 AC 71 ms
75,996 KB
testcase_18 AC 70 ms
75,716 KB
testcase_19 AC 71 ms
75,992 KB
testcase_20 AC 67 ms
71,460 KB
testcase_21 AC 66 ms
71,096 KB
testcase_22 AC 67 ms
71,216 KB
testcase_23 AC 65 ms
71,488 KB
testcase_24 AC 66 ms
71,308 KB
testcase_25 AC 66 ms
71,432 KB
testcase_26 AC 67 ms
71,288 KB
testcase_27 AC 68 ms
71,280 KB
testcase_28 AC 66 ms
71,416 KB
testcase_29 AC 71 ms
75,888 KB
testcase_30 AC 70 ms
75,724 KB
testcase_31 AC 64 ms
71,548 KB
testcase_32 AC 68 ms
71,156 KB
testcase_33 AC 69 ms
71,368 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

L=int(input())
N=int(input())
W=sorted([int(i) for i in input().split()])
cnt=0
for i in range(N):
    if cnt+W[i]<=L:
        cnt+=W[i]
    else:
        print(i)
        exit()
print(N)
0