A11655 | Resource Distribution
时间限制1s
内存限制256MB
通过 / 提交0/0
题目描述
The first line contains three integers $n$ , $x_1$ , $x_2$ ( $2 \leq n \leq 300\,000$ , $1 \leq x_1, x_2 \leq 10^9$ ) — the number of servers that the department may use, and resource units requirements for each of the services.
The second line contains $n$ space-separated integers $c_1, c_2, \ldots, c_n$ ( $1 \leq c_i \leq 10^9$ ) — the number of resource units provided by each of the servers.
The second line contains $n$ space-separated integers $c_1, c_2, \ldots, c_n$ ( $1 \leq c_i \leq 10^9$ ) — the number of resource units provided by each of the servers.
输入格式
If it is impossible to deploy both services using the given servers, print the only word "No" (without the quotes).
Otherwise print the word "Yes" (without the quotes).
In the second line print two integers $k_1$ and $k_2$ ( $1 \leq k_1, k_2 \leq n$ ) — the number of servers used for each of the services.
In the third line print $k_1$ integers, the indices of the servers that will be used for the first service.
In the fourth line print $k_2$ integers, the indices of the servers that will be used for the second service.
No index may appear twice among the indices you print in the last two lines. If there are several possible answers, it is allowed to print any of them.
Otherwise print the word "Yes" (without the quotes).
In the second line print two integers $k_1$ and $k_2$ ( $1 \leq k_1, k_2 \leq n$ ) — the number of servers used for each of the services.
In the third line print $k_1$ integers, the indices of the servers that will be used for the first service.
In the fourth line print $k_2$ integers, the indices of the servers that will be used for the second service.
No index may appear twice among the indices you print in the last two lines. If there are several possible answers, it is allowed to print any of them.
输出格式
In the first sample test each of the servers 1, 2 and 6 will will provide $8 / 3 = 2.(6)$ resource units and each of the servers 5, 4 will provide $16 / 2 = 8$ resource units.
In the second sample test the first server will provide $20$ resource units and each of the remaining servers will provide $32 / 3 = 10.(6)$ resource units.
In the second sample test the first server will provide $20$ resource units and each of the remaining servers will provide $32 / 3 = 10.(6)$ resource units.
输入输出样例
输入 #1
6 8 16 3 5 2 9 8 7
输出 #1
Yes 3 2 1 2 6 5 4
输入 #2
4 20 32 21 11 11 12
输出 #2
Yes 1 3 1 2 3 4
输入 #3
4 11 32 5 5 16 16
输出 #3
No
输入 #4
5 12 20 7 8 4 11 9
输出 #4
No
In the first sample test each of the servers 1, 2 and 6 will will provide $8 / 3 = 2.(6)$ resource units and each of the servers 5, 4 will provide $16 / 2 = 8$ resource units.
In the second sample test the first server will provide $20$ resource units and each of the remaining servers will provide $32 / 3 = 10.(6)$ resource units.
In the second sample test the first server will provide $20$ resource units and each of the remaining servers will provide $32 / 3 = 10.(6)$ resource units.
C++ 编辑器
输入
输出
可保存默认模板;新题优先使用已保存模板。
当前快捷键仅展示,暂不支持修改。
- 撤销
Ctrl / ⌘ + Z - 重做
Ctrl / ⌘ + Y - 查找
Ctrl / ⌘ + F - 全选
Ctrl / ⌘ + A - 复制
Ctrl / ⌘ + C - 剪切
Ctrl / ⌘ + X - 粘贴
Ctrl / ⌘ + V - 自动排版
工具栏排版按钮 - 草稿保存
编辑时自动保存到本机
历史
提交记录
状态说明时间源码
AI
作答助手
你好,我是作答助手。可以问思路、复杂度、样例含义或代码报错原因;不会直接给出完整 AC 代码。
确定要清空代码吗?
提交通过
评测结果:Accepted