結果

問題 No.1046 Fruits Rush
ユーザー brthyyjpbrthyyjp
提出日時 2020-05-08 21:21:46
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 190 bytes
コンパイル時間 1,225 ms
コンパイル使用メモリ 86,292 KB
実行使用メモリ 71,096 KB
最終ジャッジ日時 2023-09-17 00:50:21
合計ジャッジ時間 3,101 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 60 ms
70,988 KB
testcase_01 AC 60 ms
70,912 KB
testcase_02 AC 60 ms
70,916 KB
testcase_03 AC 61 ms
70,992 KB
testcase_04 AC 61 ms
71,012 KB
testcase_05 AC 63 ms
70,992 KB
testcase_06 AC 68 ms
70,988 KB
testcase_07 AC 66 ms
70,924 KB
testcase_08 AC 65 ms
70,996 KB
testcase_09 AC 60 ms
70,984 KB
testcase_10 AC 59 ms
70,796 KB
testcase_11 AC 60 ms
71,060 KB
testcase_12 AC 59 ms
70,828 KB
testcase_13 AC 60 ms
70,876 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

n, k = map(int, input().split())
A = list(map(int, input().split()))
A.sort(reverse=True)
ans = 0
for i in range(k):
    if A[i] >= 0:
        ans += A[i]
    else:
        break
print(ans)
0