結果
| 問題 | No.1046 Fruits Rush |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-06-18 23:01:15 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 25 ms / 2,000 ms |
| コード長 | 181 bytes |
| 記録 | |
| コンパイル時間 | 123 ms |
| コンパイル使用メモリ | 85,352 KB |
| 実行使用メモリ | 53,348 KB |
| 最終ジャッジ日時 | 2026-03-06 04:10:13 |
| 合計ジャッジ時間 | 976 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 14 |
ソースコード
n, k = map(int, input().split())
a = list(map(int, input().split()))
a = sorted(a, reverse=True)
ma = a[0]
s = a[0]
for i in range(1, k):
s += a[i]
ma = max(ma, s)
print(ma)