結果

問題 No.2370 He ate many cakes
ユーザー とりゐとりゐ
提出日時 2023-07-04 00:11:46
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 291 ms / 2,000 ms
コード長 138 bytes
コンパイル時間 287 ms
コンパイル使用メモリ 87,256 KB
実行使用メモリ 254,176 KB
最終ジャッジ日時 2023-09-24 21:21:30
合計ジャッジ時間 3,985 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
71,448 KB
testcase_01 AC 76 ms
71,276 KB
testcase_02 AC 75 ms
71,368 KB
testcase_03 AC 183 ms
174,180 KB
testcase_04 AC 75 ms
71,132 KB
testcase_05 AC 76 ms
71,356 KB
testcase_06 AC 73 ms
71,328 KB
testcase_07 AC 74 ms
71,332 KB
testcase_08 AC 76 ms
71,416 KB
testcase_09 AC 74 ms
71,336 KB
testcase_10 AC 88 ms
80,916 KB
testcase_11 AC 121 ms
116,932 KB
testcase_12 AC 201 ms
198,588 KB
testcase_13 AC 239 ms
247,516 KB
testcase_14 AC 138 ms
134,328 KB
testcase_15 AC 291 ms
248,960 KB
testcase_16 AC 232 ms
254,176 KB
testcase_17 AC 270 ms
253,380 KB
testcase_18 AC 96 ms
92,392 KB
testcase_19 AC 77 ms
71,480 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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