| # | User | Rating |
|---|---|---|
| 1 | Benq | 3792 |
| 2 | VivaciousAubergine | 3647 |
| 3 | Kevin114514 | 3603 |
| 4 | jiangly | 3583 |
| 5 | strapple | 3515 |
| 6 | tourist | 3470 |
| 7 | dXqwq | 3436 |
| 8 | Radewoosh | 3415 |
| 9 | Otomachi_Una | 3413 |
| 10 | Um_nik | 3376 |
| # | User | Contrib. |
|---|---|---|
| 1 | Qingyu | 157 |
| 2 | adamant | 153 |
| 3 | Um_nik | 146 |
| 3 | Proof_by_QED | 146 |
| 5 | Dominater069 | 145 |
| 6 | errorgorn | 141 |
| 7 | cry | 139 |
| 8 | YuukiS | 135 |
| 9 | TheScrasse | 134 |
| 10 | chromate00 | 133 |
|
-8
Good stuff. Cheers |
|
+1
Let the elements of the array be a[0],a[1]...a[n-1]. Since the sum of each pair of consecutive elements has to be the same, if a[0] decreases by 1, a[1] increases by 1 and so on alternately for all a[n-1]. So if n is even there can be no net transfer of coins from the array to the robber. If n is odd however, see that sum of all elements decreases by 1 when we repeat the above process. This coin can be transferred to the robber. The final greedy process will be 1 coin transferred from a[0]->a[1], 1 coin transferred from a[2]->a[3].....a[n-3]->a[n-2] and a[n-1]->ROBBER. This process takes (n+1)/2 steps for each coin gained and pairwise sum retained. So you have to find how many times this process can be completed in 'm' operations , k times. Also make sure none of a[0],a[2],a[4]....a[n-1] become negative. |
| Name |
|---|


