cyber_simar's blog

By cyber_simar, history, 5 months ago, In English

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!

  • Vote: I like it
  • +3
  • Vote: I do not like it

»
5 months ago, # |
Rev. 3   Vote: I like it +6 Vote: I do not like it

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

»
5 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Auto comment: topic has been updated by cyber_simar (previous revision, new revision, compare).