結果

問題 No.1046 Fruits Rush
ユーザー neterukunneterukun
提出日時 2020-05-08 21:22:05
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 172 bytes
コンパイル時間 1,105 ms
コンパイル使用メモリ 86,236 KB
実行使用メモリ 71,104 KB
最終ジャッジ日時 2023-09-17 00:52:54
合計ジャッジ時間 2,970 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 59 ms
70,988 KB
testcase_01 AC 57 ms
70,940 KB
testcase_02 AC 58 ms
71,036 KB
testcase_03 AC 59 ms
71,036 KB
testcase_04 AC 60 ms
71,036 KB
testcase_05 AC 60 ms
70,988 KB
testcase_06 AC 60 ms
70,832 KB
testcase_07 AC 61 ms
71,104 KB
testcase_08 AC 58 ms
71,084 KB
testcase_09 AC 61 ms
70,968 KB
testcase_10 AC 58 ms
71,076 KB
testcase_11 AC 58 ms
70,852 KB
testcase_12 AC 58 ms
70,876 KB
testcase_13 AC 58 ms
71,032 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

n, k = map(int, input().split())
a = list(map(int, input().split()))

a = sorted(a, reverse=True)
ans = 0
for i in range(k):
    if a[i] > 0:
        ans += a[i]
print(ans)
0