Weird Product
You are given a sequence $A_1, A_2, \ldots, A_N$ and an integer $X$. The *weirdness* of a contiguous subsequence $A_l, A_{l+1}, \ldots, A_r$ is defined as $W(l, r) = \sum_{i=l}^r A_i \cdot X^{i-l}$. Find $P = \prod_{i=1}^N \prod_{j=i}^N W(i, j)^2$ modulo $998,244,353$. ### Input - The first line of the input contains a single integer $T$ denoting the number of test cases. The description of $T
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