Let's suppose you have an array A of numbers (0-255). Then, you pick a single variable K (0-255), and you create another array B. Where Bi = Ai ^ K. Is there a way to restore the original array A? If you are not giving A or K.
# | User | Rating |
---|---|---|
1 | tourist | 4009 |
2 | jiangly | 3823 |
3 | Benq | 3738 |
4 | Radewoosh | 3633 |
5 | jqdai0815 | 3620 |
6 | orzdevinwang | 3529 |
7 | ecnerwala | 3446 |
8 | Um_nik | 3396 |
9 | ksun48 | 3390 |
10 | gamegame | 3386 |
# | User | Contrib. |
---|---|---|
1 | cry | 167 |
2 | Um_nik | 163 |
3 | maomao90 | 162 |
3 | atcoder_official | 162 |
5 | adamant | 159 |
6 | -is-this-fft- | 158 |
7 | awoo | 157 |
8 | TheScrasse | 154 |
9 | Dominater069 | 153 |
9 | nor | 153 |
Let's suppose you have an array A of numbers (0-255). Then, you pick a single variable K (0-255), and you create another array B. Where Bi = Ai ^ K. Is there a way to restore the original array A? If you are not giving A or K.
Name |
---|
Anyone cares to share the solution if it's so obvious that I'm getting downvotes?
You need to be orange or red to get pluses on this website...
https://www.youtube.com/watch?v=rxPpkdSIOPE
255255 has 614 digits.
Are you sure about constraints or is there any modulo involved ?
It is not a POWER it is XOR
Thanks for pointing that out. It can confuse some people.
if (Ai^K = Bi) then
Ai^K^K = Bi^K, so Ai = Bi^K(because K^K = 0)
Ai^K^Ai = Bi^Ai, so K = Bi^Ai(because Ai^Ai = 0)
That's how we can find Ai, when we have Bi and K or we can find K, when we have Ai and Bi.