結果

問題 No.5 数字のブロック
ユーザー aceroidaceroid
提出日時 2017-03-07 20:01:16
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 21 ms / 5,000 ms
コード長 289 bytes
コンパイル時間 299 ms
コンパイル使用メモリ 10,528 KB
実行使用メモリ 9,176 KB
最終ジャッジ日時 2023-08-11 17:08:52
合計ジャッジ時間 2,253 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,808 KB
testcase_01 AC 17 ms
7,784 KB
testcase_02 AC 16 ms
7,844 KB
testcase_03 AC 19 ms
8,876 KB
testcase_04 AC 18 ms
8,608 KB
testcase_05 AC 20 ms
9,060 KB
testcase_06 AC 18 ms
8,624 KB
testcase_07 AC 18 ms
8,712 KB
testcase_08 AC 18 ms
8,864 KB
testcase_09 AC 16 ms
8,140 KB
testcase_10 AC 20 ms
9,148 KB
testcase_11 AC 19 ms
8,628 KB
testcase_12 AC 19 ms
8,920 KB
testcase_13 AC 20 ms
8,920 KB
testcase_14 AC 17 ms
7,752 KB
testcase_15 AC 16 ms
7,796 KB
testcase_16 AC 20 ms
9,088 KB
testcase_17 AC 20 ms
9,060 KB
testcase_18 AC 21 ms
9,176 KB
testcase_19 AC 21 ms
9,156 KB
testcase_20 AC 16 ms
7,740 KB
testcase_21 AC 16 ms
7,824 KB
testcase_22 AC 16 ms
7,936 KB
testcase_23 AC 16 ms
7,784 KB
testcase_24 AC 16 ms
7,740 KB
testcase_25 AC 16 ms
7,744 KB
testcase_26 AC 16 ms
7,740 KB
testcase_27 AC 16 ms
7,768 KB
testcase_28 AC 17 ms
7,840 KB
testcase_29 AC 18 ms
8,608 KB
testcase_30 AC 17 ms
8,080 KB
testcase_31 AC 16 ms
7,840 KB
testcase_32 AC 16 ms
7,844 KB
testcase_33 AC 16 ms
7,896 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

a = input()
b = input()
c = input().split()
d = [int(i) for i in c]
d.sort()
sums = 0
count = 0
for i in d:
    sums += i
    if sums < int(a):
        count += 1
        continue
    elif sums == int(a):
        count += 1
        break
    elif sums > int(a):
        break
print(count)
0