C. 2025mzwc与朱元思数

    Type: Default 1000ms 256MiB

2025mzwc与朱元思数

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

题目背景

夹岸高山,皆生函数,一次函数,二次函数,三角函数,对数函数,指数函数 ...

---《与朱元思数》

《与朱元思书》

题目描述

夹岸里生出了一个长度为 NN 的数列 A=(A1,A2,A3...AN)A = (A_1, A_2, A_3 ... A_N),随后生出了一个函数 f(A,K)f(A,K)f(A,K)f(A,K)AA 中从大到小的前 KK 个数之和,求 f(A,K)f(A,K) 的值。KK 会在输入中给出。

输入格式

第一行两个整数 N,KN,K 。 第二行 NN 个整数,AiA_i

输出格式

输出一个整数,f(A,K)f(A,K)

样例

输入1

5 2
5 4 3 2 1

输出1

9

说明/提示

1KN105,1Ai109+71\le K \le N \le 10^5,1 \le A_i \le 10^9+7

蒙自市2025年冬令营结营测试

Not Attended
Status
Done
Rule
IOI
Problem
6
Start at
2025-2-20 14:30
End at
2025-2-20 16:30
Duration
2 hour(s)
Host
Partic.
66