Yesterday, I was curious about this problem Given an array
Construct another array
such that the value
is maximized.
| № | Пользователь | Рейтинг |
|---|---|---|
| 1 | Benq | 3792 |
| 2 | VivaciousAubergine | 3647 |
| 3 | Kevin114514 | 3603 |
| 4 | jiangly | 3583 |
| 5 | turmax | 3559 |
| 6 | tourist | 3541 |
| 7 | strapple | 3515 |
| 8 | ksun48 | 3461 |
| 9 | dXqwq | 3436 |
| 10 | Otomachi_Una | 3413 |
| Страны | Города | Организации | Всё → |
| № | Пользователь | Вклад |
|---|---|---|
| 1 | Qingyu | 157 |
| 2 | adamant | 153 |
| 3 | Um_nik | 146 |
| 3 | Proof_by_QED | 146 |
| 5 | Dominater069 | 145 |
| 6 | errorgorn | 141 |
| 7 | cry | 139 |
| 8 | YuukiS | 135 |
| 9 | TheScrasse | 134 |
| 10 | chromate00 | 133 |
Yesterday, I was curious about this problem Given an array
Construct another array
such that the value
is maximized.
| Название |
|---|



Auto comment: topic has been updated by bassuniz (previous revision, new revision, compare).
lets say you are having array A of length 100. so usually if we assume all elements <= 10^18 then try to construct array B like Ai xor Bi will be something like this...
from i = 0,
2^63, 2^62, ....2^1, 2^0(for remaining i construct 0 only) so at last the answer of xor of all this elements will be maximum. because if n >= 64 then it may be having value 2^64-1 not less then that (according to number of elements).so construct array b as...
this will be giving maximum answer of expression at last.