結果

問題 No.2370 He ate many cakes
ユーザー とりゐとりゐ
提出日時 2023-07-04 00:09:20
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 345 ms / 2,000 ms
コード長 182 bytes
コンパイル時間 300 ms
コンパイル使用メモリ 87,112 KB
実行使用メモリ 243,596 KB
最終ジャッジ日時 2023-09-24 21:18:47
合計ジャッジ時間 4,061 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
71,288 KB
testcase_01 AC 76 ms
71,448 KB
testcase_02 AC 73 ms
71,300 KB
testcase_03 AC 176 ms
143,416 KB
testcase_04 AC 80 ms
71,124 KB
testcase_05 AC 78 ms
71,224 KB
testcase_06 AC 76 ms
71,464 KB
testcase_07 AC 76 ms
71,584 KB
testcase_08 AC 79 ms
71,520 KB
testcase_09 AC 78 ms
71,268 KB
testcase_10 AC 82 ms
78,144 KB
testcase_11 AC 113 ms
102,428 KB
testcase_12 AC 175 ms
155,848 KB
testcase_13 AC 217 ms
190,900 KB
testcase_14 AC 130 ms
113,588 KB
testcase_15 AC 301 ms
243,596 KB
testcase_16 AC 345 ms
234,384 KB
testcase_17 AC 255 ms
237,920 KB
testcase_18 AC 94 ms
86,984 KB
testcase_19 AC 76 ms
71,088 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,k=map(int,input().split())
a=list(map(int,input().split()))
a.sort(reverse=True)
tmp=[0]
for i in a:
  tmp+=[j+i for j in tmp]
  tmp.sort(reverse=True)
  tmp=tmp[:k]
print(tmp[-1])
0