結果

問題 No.2370 He ate many cakes
ユーザー komkompi
提出日時 2023-07-08 13:37:14
言語 PyPy3
(8.0.0 + ACL)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 181 ms / 2,000 ms
+ 231µs
コード長 275 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 406 ms
コンパイル使用メモリ 64,260 KB
実行使用メモリ 99,676 KB
最終ジャッジ日時 2026-10-26 21:58:21
合計ジャッジ時間 3,493 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge5_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 18
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

# coding: utf-8
# Your code here!

N,K=map(int,input().split())

A=list(map(int,input().split()))

solves=[0]

for a in A:
    temp=[]
    for solve in solves:
        temp.append(solve-a)
    
    solves+=temp
    
    solves.sort()
    solves=solves[:K]

print(-solves[-1])
0