結果

問題 No.1046 Fruits Rush
ユーザー 👑 KazunKazun
提出日時 2020-12-04 19:26:04
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 72 ms / 2,000 ms
コード長 166 bytes
コンパイル時間 296 ms
コンパイル使用メモリ 87,128 KB
実行使用メモリ 71,588 KB
最終ジャッジ日時 2023-10-13 09:11:12
合計ジャッジ時間 2,817 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,588 KB
testcase_01 AC 71 ms
71,380 KB
testcase_02 AC 72 ms
71,300 KB
testcase_03 AC 71 ms
71,488 KB
testcase_04 AC 72 ms
71,312 KB
testcase_05 AC 71 ms
71,496 KB
testcase_06 AC 70 ms
71,312 KB
testcase_07 AC 71 ms
71,424 KB
testcase_08 AC 71 ms
71,464 KB
testcase_09 AC 70 ms
71,296 KB
testcase_10 AC 71 ms
71,280 KB
testcase_11 AC 70 ms
71,300 KB
testcase_12 AC 72 ms
71,192 KB
testcase_13 AC 72 ms
71,404 KB
testcase_14 AC 70 ms
71,556 KB
testcase_15 AC 70 ms
71,156 KB
testcase_16 AC 71 ms
71,504 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,K=map(int,input().split())
A=list(map(int,input().split()))

A.sort(reverse=True)

X=0
for i in range(K):
    if A[i]<0 and i>=1:
        break
    X+=A[i]
print(X)
0