結果
| 問題 |
No.1046 Fruits Rush
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-03-23 22:53:03 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 38 ms / 2,000 ms |
| コード長 | 200 bytes |
| コンパイル時間 | 224 ms |
| コンパイル使用メモリ | 82,644 KB |
| 実行使用メモリ | 53,620 KB |
| 最終ジャッジ日時 | 2024-10-12 02:14:36 |
| 合計ジャッジ時間 | 1,489 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 14 |
ソースコード
n,k = map(int,input().split())
A = sorted(map(int,input().split()))[::-1]
ans = 0
for i in range(k):
if i == 0:
ans += A[i]
continue
if A[i] > 0:
ans += A[i]
print(ans)