买东西
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.
题目描述
有 个物品,每个物品价格 ,收益为 ,由于一些奥妙重重的原因,当你买了一些物品,总价格为选择的 的按位或而不是代数相加!
你身上只有 元钱,你希望选择总价格不超过 的一些物品,来获得最大的收益。
输入格式
第一行两个整数 。
接下来 行,每行两个整数 ,意义见题目描述。
输出格式
一行一个整数,表示答案。
样例输入
3 7
5 10
6 100
8 1000
样例输出
110
数据范围
对于的数据,
对于另外的数据,
对于所有数据,$1\leq n\leq 10^5,0\leq k < 2^{30},0\leq A_i < 2^{30},0\leq B_i \leq 10^9$
2023CSP赛前冲刺模拟7
- Status
- Done
- Rule
- OI
- Problem
- 4
- Start at
- 2023-10-4 8:30
- End at
- 2023-10-4 12:00
- Duration
- 3.5 hour(s)
- Host
- Partic.
- 4