← All problemsSign in

No 3 Please!

CodeChefRating 1620Open on judge ↗

For an array $B$ of length $M$, we define the following: - The *prefix sum array* of $B$ is an array $P$, also of length $M$, such that $P_i = B_1 + B_2 + \ldots + B_i$ - $B$ is called *good*, if every element of its prefix sum array is **not** a multiple of $3$. For example, $B = [1, 1, 2, 1]$ is a *good* array, because its prefix sum array is $[1, 2, 4, 5]$ and none of them are multiples of $

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