← All problemsSign in

And-Or Game

CodeChefRating 3026Open on judge ↗

Chef is playing a game with two sequences of non-negative integers $A_1, A_2, \ldots, A_N$ and $B_1, B_2, \ldots, B_M$. He has an integer $V$, which is initially equal to $0$. Chef will play for a number of turns he chooses (possibly zero); he stops playing when he gets bored. In each turn of the game, Chef must perform one of the following operations: - Choose an integer $X$ from $A$ and change

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