結果

問題 No.1046 Fruits Rush
ユーザー eQeeQe
提出日時 2020-05-09 08:45:48
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 470 bytes
コンパイル時間 725 ms
コンパイル使用メモリ 86,920 KB
実行使用メモリ 72,876 KB
最終ジャッジ日時 2023-09-18 13:29:47
合計ジャッジ時間 3,713 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 119 ms
72,644 KB
testcase_01 AC 119 ms
72,596 KB
testcase_02 AC 117 ms
72,176 KB
testcase_03 AC 118 ms
72,700 KB
testcase_04 AC 118 ms
72,372 KB
testcase_05 AC 115 ms
72,520 KB
testcase_06 AC 116 ms
72,128 KB
testcase_07 AC 117 ms
72,308 KB
testcase_08 AC 117 ms
72,460 KB
testcase_09 AC 116 ms
72,536 KB
testcase_10 AC 116 ms
72,636 KB
testcase_11 AC 115 ms
72,596 KB
testcase_12 AC 119 ms
72,580 KB
testcase_13 AC 119 ms
72,608 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import math
from math import sqrt
import sys
from collections import deque, defaultdict
from heapq import heappop, heappush
from copy import deepcopy

INF=10**18
MOD=10**9+7
MAX=10**5+7

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

def main():
  N,K=map(int, input().split())
  A = list(map(int, input().split()))
  A.sort()
  A=A[::-1]
  ans=0
  for i in range(K):
    if A[i]>0: ans+=A[i]

  print(ans)


if __name__ == '__main__':
    main()



0