結果

問題 No.5 数字のブロック
ユーザー syunsuke1024syunsuke1024
提出日時 2020-05-06 13:01:02
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 78 ms / 5,000 ms
コード長 197 bytes
コンパイル時間 585 ms
コンパイル使用メモリ 87,112 KB
実行使用メモリ 75,868 KB
最終ジャッジ日時 2023-09-10 23:09:24
合計ジャッジ時間 4,688 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,040 KB
testcase_01 AC 75 ms
71,156 KB
testcase_02 AC 74 ms
71,152 KB
testcase_03 AC 77 ms
75,400 KB
testcase_04 AC 75 ms
75,460 KB
testcase_05 AC 75 ms
75,704 KB
testcase_06 AC 76 ms
75,868 KB
testcase_07 AC 76 ms
75,656 KB
testcase_08 AC 76 ms
75,436 KB
testcase_09 AC 75 ms
75,504 KB
testcase_10 AC 78 ms
75,484 KB
testcase_11 AC 76 ms
75,456 KB
testcase_12 AC 77 ms
75,416 KB
testcase_13 AC 77 ms
75,500 KB
testcase_14 AC 71 ms
71,224 KB
testcase_15 AC 72 ms
71,220 KB
testcase_16 AC 76 ms
75,408 KB
testcase_17 AC 76 ms
75,460 KB
testcase_18 AC 74 ms
75,348 KB
testcase_19 AC 77 ms
75,700 KB
testcase_20 AC 73 ms
71,220 KB
testcase_21 AC 75 ms
71,112 KB
testcase_22 AC 71 ms
71,040 KB
testcase_23 AC 72 ms
71,328 KB
testcase_24 AC 73 ms
71,108 KB
testcase_25 AC 71 ms
71,304 KB
testcase_26 AC 72 ms
71,228 KB
testcase_27 AC 73 ms
71,004 KB
testcase_28 AC 73 ms
71,060 KB
testcase_29 AC 77 ms
75,708 KB
testcase_30 AC 75 ms
75,588 KB
testcase_31 AC 74 ms
71,260 KB
testcase_32 AC 72 ms
71,036 KB
testcase_33 AC 75 ms
71,040 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

Size=int(input())
N=int(input())
W=list(map(int,input().split()))

W.sort()
cnt=0
Sum=0
for i in range(N):
    if Sum+W[i]<=Size:
        cnt+=1
        Sum+=W[i]
    else:
        break
print(cnt)
0