Chef and Vectors
Chef has an integer array X, and a binary array S, both of size N. He wants to know how many vectors (denote by V) of N elements exist, for which the following conditions hold for all valid indices i (that is, for all 1 ≤ i ≤ N). - 0 ≤ Vi 18 - If Si = 1, Vi is ≥ Xi, and if Si = 0, Vi ≤ Xi - Sum of the elements of V, when viewed as a string, contains "47" as a substring. Please help Chef find th
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