cf/mirror

Survival of the Weakest (hard version)

CF
1805F23100· legendary gm3s256 MB⌨ stdin/stdout

Examples

Sample 1of 4
Input
5
1 2 4 5 6
Output
34
Sample 2of 4
Input
9
1 1 1 7 7 7 9 9 9
Output
256
Sample 3of 4
Input
7
1 7 9 2 0 0 9
Output
20
Sample 4of 4
Input
3
1000000000 1000000000 777
Output
1540
1805F2.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)