結果

問題 No.5 数字のブロック
ユーザー tuntun
提出日時 2023-01-24 23:15:40
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 386 bytes
コンパイル時間 95 ms
コンパイル使用メモリ 10,712 KB
実行使用メモリ 9,164 KB
最終ジャッジ日時 2023-09-08 15:02:57
合計ジャッジ時間 1,961 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,788 KB
testcase_01 AC 15 ms
7,868 KB
testcase_02 WA -
testcase_03 AC 18 ms
8,700 KB
testcase_04 WA -
testcase_05 AC 18 ms
8,996 KB
testcase_06 AC 17 ms
8,684 KB
testcase_07 AC 16 ms
8,548 KB
testcase_08 AC 17 ms
8,836 KB
testcase_09 AC 15 ms
8,260 KB
testcase_10 AC 19 ms
9,124 KB
testcase_11 AC 17 ms
8,480 KB
testcase_12 AC 18 ms
8,852 KB
testcase_13 AC 18 ms
8,932 KB
testcase_14 AC 15 ms
7,788 KB
testcase_15 AC 15 ms
7,824 KB
testcase_16 AC 18 ms
9,012 KB
testcase_17 AC 19 ms
9,164 KB
testcase_18 AC 19 ms
9,096 KB
testcase_19 AC 20 ms
9,096 KB
testcase_20 AC 15 ms
7,768 KB
testcase_21 AC 15 ms
7,856 KB
testcase_22 AC 15 ms
7,788 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 15 ms
7,780 KB
testcase_27 AC 15 ms
7,800 KB
testcase_28 WA -
testcase_29 AC 17 ms
8,528 KB
testcase_30 AC 16 ms
8,284 KB
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

l = int(input())
n = int(input())
w = list(map(int, input().split())) #一列&スペースで並んだ複数のintデータを受け取る

w_sort = sorted(w)
#print(w_sort)

for i in range(1,n):
    l -=w_sort[i]
   # print(l,i) #確認


    if l == 0:
        print(i + 1)
        break
    elif l < 0:
        print(i)
        break
    if i == n-1:
        print(n)
        break

0