Hi Codeforces! I was wondering if we could compute a ^ (a + b) ^ (a + 2b) ^ ... ^ (a + kb) in O(1) or such. Thought about it a lot but still I have no solutions :( Do you have any idea? Thank you!
| # | User | Rating |
|---|---|---|
| 1 | Benq | 3792 |
| 2 | VivaciousAubergine | 3647 |
| 3 | Kevin114514 | 3611 |
| 4 | jiangly | 3583 |
| 5 | strapple | 3515 |
| 6 | tourist | 3470 |
| 7 | Radewoosh | 3415 |
| 8 | Um_nik | 3376 |
| 9 | maroonrk | 3361 |
| 10 | XVIII | 3345 |
| # | User | Contrib. |
|---|---|---|
| 1 | Qingyu | 162 |
| 2 | adamant | 148 |
| 3 | Um_nik | 146 |
| 4 | Dominater069 | 143 |
| 5 | errorgorn | 141 |
| 6 | cry | 138 |
| 7 | Proof_by_QED | 136 |
| 8 | YuukiS | 135 |
| 9 | chromate00 | 134 |
| 10 | soullless | 133 |
Hi Codeforces! I was wondering if we could compute a ^ (a + b) ^ (a + 2b) ^ ... ^ (a + kb) in O(1) or such. Thought about it a lot but still I have no solutions :( Do you have any idea? Thank you!
| Name |
|---|



I didn't quite get the idea. Can you explain it more detailed?
Fine, here you go.
There are three parameters:
a,bandk. Let us first learn how to solve simpler problems by fixing some of the parameters to some small values.With
a = 1,k = 1, solve the problemf (b) = a ^ (a + b) ^ (a + 2b) ^ ... ^ (a + kb). Output the first few values and observe.Once you have the solution for the simpler problem, you can return
aandkas parameters. Fora, it is justg (a, b) = f (b) - f (a - 1). Fork, it is perhapsh (a, b, k) = g (a, b) * kor something similar.If
a = 1,k = 1then obviouslyf(b) = 1 ^ (b + 1), I guess?If so then g(a, b) as provided by you is wrong, I suppose.
Ow, sorry, I mixed up the letters
bandk. The interesting problem reduction isf (k)fora = 1,b = 1, notf (b)fora = 1,k = 1. Then returnaandbinto the picture.I could not figure out any way to restore
b. It seems even witha = 1it has no pattern at all?http://mirror.codeforces.com/blog/entry/2154
UPD: seems like I mixed the letters up as well