D-Value
Dr.D is bored, so he's making up problems to pass the time. Here is one of them. You are given a sequence $A_1, A_2, \ldots, A_N$. Find the number of 7-tuples of indices $(a, b, c, d, e, f, g)$ such that: - $1 \le a \lt b \lt c \lt d \lt e \lt f \lt g \le N$ - $A_g \lt A_e \lt A_f \lt A_d \lt A_b \lt A_c \lt A_a$ Since this number could be huge, compute it modulo $987654319$. ### Input - The fi
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