結果

問題 No.5 数字のブロック
ユーザー IHIH
提出日時 2021-01-08 19:25:04
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 74 ms / 5,000 ms
コード長 186 bytes
コンパイル時間 291 ms
コンパイル使用メモリ 87,404 KB
実行使用メモリ 75,908 KB
最終ジャッジ日時 2023-08-10 02:43:44
合計ジャッジ時間 4,178 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
71,196 KB
testcase_01 AC 70 ms
71,328 KB
testcase_02 AC 69 ms
71,368 KB
testcase_03 AC 74 ms
75,744 KB
testcase_04 AC 71 ms
75,720 KB
testcase_05 AC 72 ms
75,704 KB
testcase_06 AC 72 ms
75,824 KB
testcase_07 AC 69 ms
75,740 KB
testcase_08 AC 73 ms
75,804 KB
testcase_09 AC 70 ms
75,908 KB
testcase_10 AC 72 ms
75,804 KB
testcase_11 AC 71 ms
75,708 KB
testcase_12 AC 71 ms
75,888 KB
testcase_13 AC 72 ms
75,880 KB
testcase_14 AC 68 ms
71,096 KB
testcase_15 AC 70 ms
71,548 KB
testcase_16 AC 74 ms
75,852 KB
testcase_17 AC 73 ms
75,748 KB
testcase_18 AC 72 ms
75,840 KB
testcase_19 AC 73 ms
75,820 KB
testcase_20 AC 69 ms
71,292 KB
testcase_21 AC 68 ms
71,096 KB
testcase_22 AC 70 ms
71,296 KB
testcase_23 AC 69 ms
71,192 KB
testcase_24 AC 69 ms
71,508 KB
testcase_25 AC 68 ms
71,120 KB
testcase_26 AC 68 ms
71,336 KB
testcase_27 AC 65 ms
71,292 KB
testcase_28 AC 66 ms
71,332 KB
testcase_29 AC 72 ms
75,780 KB
testcase_30 AC 69 ms
75,856 KB
testcase_31 AC 66 ms
71,296 KB
testcase_32 AC 66 ms
71,392 KB
testcase_33 AC 68 ms
71,356 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

l = int(input())
n = int(input())
w = list(map(int,input().split()))

w.sort()

c = 0
for i in range(n):
  if l >= w[i]:
    l -= w[i]
    c += 1
  else:
    print(c)
    exit()
print(c)
0