結果

問題 No.1046 Fruits Rush
ユーザー tamatotamato
提出日時 2020-05-08 21:21:12
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 327 bytes
コンパイル時間 343 ms
コンパイル使用メモリ 87,692 KB
実行使用メモリ 72,024 KB
最終ジャッジ日時 2023-09-17 00:45:42
合計ジャッジ時間 2,370 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 65 ms
71,988 KB
testcase_01 AC 64 ms
71,736 KB
testcase_02 AC 65 ms
71,652 KB
testcase_03 AC 65 ms
72,020 KB
testcase_04 AC 64 ms
71,604 KB
testcase_05 AC 65 ms
71,816 KB
testcase_06 AC 68 ms
71,512 KB
testcase_07 AC 66 ms
71,960 KB
testcase_08 AC 66 ms
71,960 KB
testcase_09 AC 66 ms
71,552 KB
testcase_10 AC 64 ms
71,552 KB
testcase_11 AC 64 ms
72,024 KB
testcase_12 AC 63 ms
71,960 KB
testcase_13 AC 65 ms
71,652 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = 1000000007
eps = 10**-9


def main():
    import sys
    input = sys.stdin.readline

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


if __name__ == '__main__':
    main()
0