結果
| 問題 |
No.1046 Fruits Rush
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-05-09 17:10:04 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 524 bytes |
| コンパイル時間 | 154 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 10,880 KB |
| 最終ジャッジ日時 | 2024-07-05 22:12:51 |
| 合計ジャッジ時間 | 1,228 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 11 WA * 3 |
ソースコード
#import numpy as np
import sys
from collections import defaultdict
read = sys.stdin.buffer.read
readline = sys.stdin.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(100)
n , k = map(int,input().split())
A = list(map(int,input().split()))
fruit = sorted(A , reverse= True)
delicious = 0
index = 0
number_fruit = 0
while number_fruit < k and index < n:
if fruit[index] > 0 :
delicious += fruit[index]
number_fruit += 1
else:
break
index += 1
print(delicious)