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!
| № | Пользователь | Рейтинг |
|---|---|---|
| 1 | Benq | 3792 |
| 2 | VivaciousAubergine | 3647 |
| 3 | Kevin114514 | 3603 |
| 4 | jiangly | 3583 |
| 5 | turmax | 3559 |
| 6 | tourist | 3541 |
| 7 | strapple | 3515 |
| 8 | ksun48 | 3461 |
| 9 | dXqwq | 3436 |
| 10 | Otomachi_Una | 3413 |
| Страны | Города | Организации | Всё → |
| № | Пользователь | Вклад |
|---|---|---|
| 1 | Qingyu | 157 |
| 2 | adamant | 153 |
| 3 | Um_nik | 147 |
| 3 | Proof_by_QED | 147 |
| 5 | Dominater069 | 145 |
| 6 | errorgorn | 142 |
| 7 | cry | 139 |
| 8 | YuukiS | 135 |
| 9 | TheScrasse | 134 |
| 10 | chromate00 | 133 |
| Название |
|---|



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