Random Knapsack
You are given $N = 240$ integers, randomly generated in $[0; 998\,244\,353)$. You need to answer $Q$ queries, in each query, you are given one integer $X$, $0 \leq X < 998\,244\,353$. And you need to find a subset of given integers with sum $X$, modulo $998\,244\,353$. For each test case, it is guaranteed that at least one such subset exists. ###Input: - The first line contains one int
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