結果
| 問題 | No.1046 Fruits Rush |
| コンテスト | |
| ユーザー |
nasubi24
|
| 提出日時 | 2020-11-02 16:56:51 |
| 言語 | Python3 (3.14.7 + numpy 2.5.2 + scipy 1.18.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 95 ms / 2,000 ms |
| + 643µs | |
| コード長 | 189 bytes |
| 記録 | |
| コンパイル時間 | 285 ms |
| コンパイル使用メモリ | 21,284 KB |
| 実行使用メモリ | 15,740 KB |
| 最終ジャッジ日時 | 2026-08-23 01:17:32 |
| 合計ジャッジ時間 | 3,421 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 14 |
ソースコード
n,k=map(int,input().split())
a=list(map(int,input().split()))
a.sort(reverse=True)
ans=0
for i in range(k):
if a[i]>0:
ans+=a[i]
if a[0]<0:
print(a[0])
else:
print(ans)
nasubi24