分数(score)
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.
分数(score)
【题目描述】 给定一个数组, 。你每次可以选择两个位置 ,满足 ,且满足: 或 。其中&是二进制与运算。选择两个位置 后,你可以获得 (即 区间的最大值)的分数。
你可以选择任意多次,但是一个数对 只能选择一次。问你最多能获得多少分数?
【输入格式】 从文件 score.in 中读入数据。 第一行一个正整数 。 第二行 个非负整数 。
【输出格式】 输出到文件 score.out 中。 输出一行答案。
【样例 1 输入】
5
2 3 7 4 1
【样例 1 输出】
38
【样例 2】
见下发文件的 score/score2.in 与 score/score2.ans。
【样例 3】
见下发文件的 score/score3.in 与 score/score3.ans。
【样例 4】
见下发文件的 score/score4.in 与 score/score4.ans。
【样例 5】
见下发文件的 score/score5.in 与 score/score5.ans。
【数据范围与提示】
对于 100%的数据, 。
| 数据点 | 特殊性质 | |
|---|---|---|
| 1 ~ 4 | A | |
| 5 ~ 6 | 无 | |
| 7 ~ 10 | A,B | |
| 11 ~ 13 | B,C | |
| 14 ~ 16 | A | |
| 17 ~ 19 | B | |
| 20 ~ 21 | C | |
| 22 ~ 25 | 无 |
特殊性质 A:对于所有的 ,满足 。 特殊性质 B:对于所有的 ,满足 。 特殊性质 C:对于所有的 ,满足 ,其中 为非负整数。
NOIp 2026 模拟赛 11
- Status
- Done
- Rule
- OI
- Problem
- 4
- Start at
- 2026-10-28 7:40
- End at
- 2026-10-28 12:10
- Duration
- 4.5 hour(s)
- Host
- Partic.
- 24