結果
| 問題 | No.1046 Fruits Rush |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-08-09 08:53:46 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 25 ms / 2,000 ms |
| コード長 | 205 bytes |
| 記録 | |
| コンパイル時間 | 111 ms |
| コンパイル使用メモリ | 85,772 KB |
| 実行使用メモリ | 52,096 KB |
| 最終ジャッジ日時 | 2026-04-09 14:21:32 |
| 合計ジャッジ時間 | 1,373 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 14 |
ソースコード
N,K=map(int,input().split())
A=sorted(list(map(int,input().split())),reverse=True)
if A[0]<0:
print(A[0])
else:
ans=0
for i in range(K):
if A[i]>=0:
ans+=A[i]
print(ans)