Cash Money

Some Samples to help you because uploader is not lazy :D

Sample Input 1

4
1 2 2 1

Sample Output 1

52

Sample Input 2

10
3 1 4 1 5 9 2 6 5 4

Sample Output 2

999961696


Submitting .cpp to 'Cash Money'


You're not logged in! Click here to login

Time Limit: 2 Seconds
Memory Limit: 256MB
Your best score: 0
Source: 2020 CNY

Subtask Score
1 3
2 18
3 79
4 0