結果

問題 No.1046 Fruits Rush
ユーザー convexineq
提出日時 2020-05-08 21:21:17
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 359 bytes
コンパイル時間 84 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-07-03 23:08:44
合計ジャッジ時間 1,259 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 11 WA * 3
権限があれば一括ダウンロードができます

ソースコード

diff #

# coding: utf-8
# Your code here!
import sys
read = sys.stdin.read
readline = sys.stdin.readline 
readlines = sys.stdin.readlines

#n = int(input())
#ab = [[int(i) for i in readline().split()] for _ in range(n)]
n,k,*a = [int(i) for i in read().split()]

a.sort()
ans = 0
for i in range(k):
    v = a.pop()
    if v > 0: ans += v
    else: break

print(ans)

0