The Prestige
CodeChefOpen on judge ↗
ChefX and ChefY just watched the eminent movie "The Prestige", so ChefX decided to perform a magic trick. First, ChefX bought two decks of cards. Each deck contains $N$ cards. The cards in the first deck are numbered $1$ through $N$ from top to bottom, while the cards in the second deck are numbered $N$ through $1$ from top to bottom. Initially, all the cards are oriented face down. For the magi
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