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 | jiangly | 3898 |
2 | tourist | 3840 |
3 | orzdevinwang | 3706 |
4 | ksun48 | 3691 |
5 | jqdai0815 | 3682 |
6 | ecnerwala | 3525 |
7 | gamegame | 3477 |
8 | Benq | 3468 |
9 | Ormlis | 3381 |
10 | maroonrk | 3379 |
# | User | Contrib. |
---|---|---|
1 | cry | 168 |
2 | -is-this-fft- | 165 |
3 | Dominater069 | 161 |
4 | Um_nik | 160 |
5 | atcoder_official | 159 |
6 | djm03178 | 157 |
7 | adamant | 153 |
8 | luogu_official | 150 |
9 | awoo | 149 |
10 | TheScrasse | 146 |
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.