A1315 | [COCI-2015_2016-contest5]#3 PERICA
来源COCI
时间限制1s
内存限制128MB
通过 / 提交0/0
题目描述
- “I’m stopping by Žnidaršić’s house, you play the piano, Perica.”
- ”Ok, dad, I will!”
And so, Perica began playing the piano. His piano consists of N keys. Each key has a value written on it, ai . When Perica plays the piano, he presses exactly K different keys at the same time. The piano is a bit strange because, after pressing K keys at the same time, it will play only the key with the largest value. Perica is going to play each combination of K keys on the piano and he wants to know the sum of values of the keys that will be played.
Help Perica determine the remainder of that number modulo 1 000 000 00
7.
- ”Ok, dad, I will!”
And so, Perica began playing the piano. His piano consists of N keys. Each key has a value written on it, ai . When Perica plays the piano, he presses exactly K different keys at the same time. The piano is a bit strange because, after pressing K keys at the same time, it will play only the key with the largest value. Perica is going to play each combination of K keys on the piano and he wants to know the sum of values of the keys that will be played.
Help Perica determine the remainder of that number modulo 1 000 000 00
7.
输入格式
The first line of input contains two integers N and K (1 6 N 6 100 000, 1 6 K 6 50).
The following line of input contains N integers ai (0 6 aij 6 109 ).
The following line of input contains N integers ai (0 6 aij 6 109 ).
输出格式
The first and only line of output must contain the required number from the task.
输入输出样例
输入 #1
5 3 2 4 2 3 4
输出 #1
39
输入 #2
5 1 1 0 1 1 1
输出 #2
4
输入 #3
5 2 3 3 4 0 0
输出 #3
31
In test cases worth 40% of total points, it will additionally hold 1 6 N 6 1000.
Pojašnjenje prvog primjera: All selections of K keys are: [2, 4, 2], [2, 4, 3], [2, 4, 4], [2, 2, 3], [2, 2, 4], [2, 3,
4], [4, 2, 3], [4, 2, 4], [4, 3, 4], [2, 3, 4].
Pojašnjenje prvog primjera: All selections of K keys are: [2, 4, 2], [2, 4, 3], [2, 4, 4], [2, 2, 3], [2, 2, 4], [2, 3,
4], [4, 2, 3], [4, 2, 4], [4, 3, 4], [2, 3, 4].
C++ 编辑器
输入
输出
可保存默认模板;新题优先使用已保存模板。
当前快捷键仅展示,暂不支持修改。
- 撤销
Ctrl / ⌘ + Z - 重做
Ctrl / ⌘ + Y - 查找
Ctrl / ⌘ + F - 全选
Ctrl / ⌘ + A - 复制
Ctrl / ⌘ + C - 剪切
Ctrl / ⌘ + X - 粘贴
Ctrl / ⌘ + V - 自动排版
工具栏排版按钮 - 草稿保存
编辑时自动保存到本机
历史
提交记录
状态说明时间源码
AI
作答助手
你好,我是作答助手。可以问思路、复杂度、样例含义或代码报错原因;不会直接给出完整 AC 代码。
确定要清空代码吗?
提交通过
评测结果:Accepted