Array Game
1076G3000· legendary gm6s512 MB⌨ stdin/stdout
Examples
Sample 1of 2
Input
5 2 41 2 3 4 51 3 5 62 2 51 1 2 32 1 5
Output
11
Sample 2of 2
Input
5 1 31 1 3 3 42 1 52 2 52 3 5
Output
121
58%
1076G.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)