Блог пользователя svanidz1

Автор svanidz1, 11 лет назад, По-английски

Does there exist an algorithm, for a given sequence to find a sub-sequence with minimum possible xor? Or at least an algorithm finding a subsequence of xor==0?

  • Проголосовать: нравится
  • +22
  • Проголосовать: не нравится

»
11 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

which asymptotic are you interesting about? For instance, one can use Meet-in-the-middle for second problem...

»
11 лет назад, # |
  Проголосовать: нравится +11 Проголосовать: не нравится

First thought: you can treat numbers like binary vectors and construct a matrix, where each row is a binary vector, corresponding to a particular number in sequence. Then you can perfrom Gaussian elimination modulo 2 on this matrix and if you have at least one all-zeroes row you can get xor == 0. If for each row R you also save indexes of rows interacted with row R during Gaussian elimination you can restore the corresponding subsequence.