← All problemsSign in

Potato to Gold

CodeChefRating 2326Open on judge ↗

You are given an array $A$ of $N$ integers and an integer $K$. Find the number of (**possibly empty**) [subsequences](https://en.wikipedia.org/wiki/Subsequence) of $A$ such that no two elements in the subsequence have a sum that is divisible by $K$. Two subsequences are considered distinct if they are made up of different indices. For example, $A = [1, 2, 1, 2]$ contains $[1, 2]$ as a subsequence

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.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start