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?
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?
# | User | Rating |
---|---|---|
1 | jiangly | 3640 |
2 | Benq | 3593 |
3 | tourist | 3572 |
4 | orzdevinwang | 3561 |
5 | cnnfls_csy | 3539 |
6 | ecnerwala | 3534 |
7 | Radewoosh | 3532 |
8 | gyh20 | 3447 |
9 | Rebelz | 3409 |
10 | Geothermal | 3408 |
# | User | Contrib. |
---|---|---|
1 | maomao90 | 173 |
2 | adamant | 164 |
3 | awoo | 161 |
4 | TheScrasse | 160 |
5 | nor | 159 |
6 | maroonrk | 156 |
7 | SecondThread | 152 |
8 | pajenegod | 146 |
9 | BledDest | 144 |
10 | Um_nik | 143 |
Name |
---|
which asymptotic are you interesting about? For instance, one can use Meet-in-the-middle for second problem...
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.
http://codeforces.com/blog/entry/1201
http://apps.topcoder.com/forums/;jsessionid=27C509BC366B5418E52684946CBFC0DF?module=Thread&threadID=704255&start=0&mc=5#1393888