Max Min Subsequence
CodeChefOpen on judge ↗
Jesse wants to solve the following problem but finds is very hard to solve. Given an array of length $n$. Let the cost of a subsequence of this array be equal to the product of the minimum and maximum values in the subsequence. Find the sum of costs of all the non-empty subsequences of this array. Since the answer can be large, print it modulo $10^9+7$. Help Jesse! ### Input - The first line of
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start