1355D - Game With Array Solving the problem is easy by observation but can anyone explain the case when Petya will loose i.e for S<2n mathematically?
# | User | Rating |
---|---|---|
1 | tourist | 3845 |
2 | jiangly | 3707 |
3 | Benq | 3630 |
4 | orzdevinwang | 3573 |
5 | Geothermal | 3569 |
5 | cnnfls_csy | 3569 |
7 | jqdai0815 | 3532 |
8 | ecnerwala | 3501 |
9 | gyh20 | 3447 |
10 | Rebelz | 3409 |
# | User | Contrib. |
---|---|---|
1 | maomao90 | 171 |
2 | adamant | 163 |
3 | awoo | 161 |
4 | nor | 152 |
5 | maroonrk | 151 |
5 | -is-this-fft- | 151 |
7 | TheScrasse | 148 |
8 | atcoder_official | 146 |
9 | Petr | 145 |
10 | pajenegod | 144 |
1355D - Game With Array Solving the problem is easy by observation but can anyone explain the case when Petya will loose i.e for S<2n mathematically?
Name |
---|
Think it this way ->
Yeah but this proof only make sense for array like [2 2 2 2....2 1 2] but array can be like some 1's some 2's and some numbers not (1's and 2's) such that S<2n
the more smaller elements, more pain in the ... so we try to distribute sum S evenly. that makes all the element 1 or 2.