結果

問題 No.5 数字のブロック
ユーザー aceroidaceroid
提出日時 2017-03-07 20:00:21
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 290 bytes
コンパイル時間 123 ms
コンパイル使用メモリ 10,556 KB
実行使用メモリ 9,344 KB
最終ジャッジ日時 2023-09-05 22:31:06
合計ジャッジ時間 2,083 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 AC 17 ms
7,956 KB
testcase_03 RE -
testcase_04 RE -
testcase_05 AC 20 ms
9,016 KB
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 AC 16 ms
7,804 KB
testcase_16 RE -
testcase_17 RE -
testcase_18 RE -
testcase_19 RE -
testcase_20 AC 16 ms
7,808 KB
testcase_21 AC 15 ms
7,952 KB
testcase_22 AC 16 ms
7,804 KB
testcase_23 RE -
testcase_24 RE -
testcase_25 RE -
testcase_26 AC 16 ms
7,872 KB
testcase_27 AC 16 ms
7,808 KB
testcase_28 AC 16 ms
7,736 KB
testcase_29 AC 18 ms
8,464 KB
testcase_30 AC 17 ms
7,992 KB
testcase_31 AC 16 ms
7,824 KB
testcase_32 AC 15 ms
7,812 KB
testcase_33 AC 15 ms
7,792 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 > inta(a):
        break
print(count)
0