C - Chef and Sequence Sums
CodeChefOpen on judge ↗
Chef has an array $A$ of $N$ integers. Chef wants to find if the array is $GOOD$ or $BAD$. To check if the array is $GOOD$ chef will perform an operation. 1) Select any array $B$ of length $N$ where $B_i$ can be any integer. 2) For Every $A_i$ $(1 \leq i \leq N)$, change it to $A_i := A_i * B_i$. 3) If there is any subsequence of the array $A$ with $sum=1$ then it is $GOOD$ else
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