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 | 3977 |
2 | tourist | 3815 |
3 | jqdai0815 | 3682 |
4 | ksun48 | 3614 |
5 | orzdevinwang | 3526 |
6 | ecnerwala | 3514 |
7 | Benq | 3483 |
8 | hos.lyric | 3381 |
9 | gamegame | 3374 |
10 | heuristica | 3358 |
# | User | Contrib. |
---|---|---|
1 | cry | 169 |
2 | -is-this-fft- | 162 |
3 | Um_nik | 161 |
4 | atcoder_official | 159 |
5 | djm03178 | 157 |
6 | Dominater069 | 156 |
7 | adamant | 154 |
8 | luogu_official | 152 |
8 | awoo | 152 |
10 | TheScrasse | 148 |
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?
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://mirror.codeforces.com/blog/entry/1201
http://apps.topcoder.com/forums/;jsessionid=27C509BC366B5418E52684946CBFC0DF?module=Thread&threadID=704255&start=0&mc=5#1393888