Eve, Psyche and the Wife of the Blue MEX
InterviewTime limit1sMemory limit1024 MB
Given N integers, compute the sum of mex({A_i, A_j}) over all pairs i<j of the array.
- Level
Easy3 of 10
- Topics
- Combinatorics, Math
- Solved
- No attempts yet
Problem
is the smallest non-negative integer not contained in the set .
Given non-negative integers , write a program that computes the following value.
Input
The first line contains an integer . ()
The second line contains integers separated by spaces. ()
Output
Print the value the problem asks for.