Given an array A of length n(n≤105, ai<250), divide it into two subsequences X and Y such that (x1|x2...) ⊕ (y1|y2...) is maximum. Print the maximum OR(X) ⊕ OR(Y).
Any help would be appreciated. Thanks!
# | User | Rating |
---|---|---|
1 | tourist | 4009 |
2 | jiangly | 3773 |
3 | Radewoosh | 3646 |
4 | ecnerwala | 3624 |
5 | jqdai0815 | 3620 |
5 | Benq | 3620 |
7 | orzdevinwang | 3612 |
8 | Geothermal | 3569 |
8 | cnnfls_csy | 3569 |
10 | gyh20 | 3447 |
# | User | Contrib. |
---|---|---|
1 | cry | 161 |
2 | Um_nik | 160 |
2 | maomao90 | 160 |
4 | awoo | 159 |
5 | atcoder_official | 157 |
6 | -is-this-fft- | 156 |
7 | nor | 155 |
7 | adamant | 155 |
9 | maroonrk | 152 |
10 | Dominater069 | 148 |
Given an array A of length n(n≤105, ai<250), divide it into two subsequences X and Y such that (x1|x2...) ⊕ (y1|y2...) is maximum. Print the maximum OR(X) ⊕ OR(Y).
Any help would be appreciated. Thanks!
Name |
---|
i believe you need to know a technique called XOR basis to solve this. its the same as this problem https://atcoder.jp/contests/abc141/tasks/abc141_f
Auto comment: topic has been updated by cyber_simar (previous revision, new revision, compare).