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!
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 | 3676 |
| 2 | Kevin114514 | 3659 |
| 3 | jiangly | 3640 |
| 4 | turmax | 3450 |
| 5 | tourist | 3382 |
| 6 | strapple | 3360 |
| 7 | Um_nik | 3354 |
| 8 | squareOf105 | 3348 |
| 9 | maroonrk | 3312 |
| 10 | idontwannadothis…e | 3191 |
| # | User | Contrib. |
|---|---|---|
| 1 | Qingyu | 155 |
| 2 | nik_exists | 151 |
| 3 | maspy | 149 |
| 4 | AmShZ | 145 |
| 5 | Um_nik | 143 |
| 6 | Errichto | 139 |
| 7 | BledDest | 136 |
| 8 | adamant | 134 |
| 9 | maroonrk | 132 |
| 10 | cry | 130 |
| 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://codeforces.me/blog/entry/2154
UPD: seems like I mixed the letters up as well