結果

問題 No.1046 Fruits Rush
ユーザー 蕎麦屋蕎麦屋
提出日時 2020-05-08 21:48:14
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 196 bytes
コンパイル時間 160 ms
コンパイル使用メモリ 82,688 KB
実行使用メモリ 52,352 KB
最終ジャッジ日時 2024-07-04 00:26:40
合計ジャッジ時間 1,317 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 11 WA * 3
権限があれば一括ダウンロードができます

ソースコード

diff #

n,k = list(map(int, input().split()))
a = list(map(int, input().split()))
a.sort(reverse=True)
count = 0
ans = 0
for i in a:
    if(i>=1 and count<k):
        count+=1
        ans+=i

print(ans)

0