Running Comparison
Alice and Bob recently got into running, and decided to compare how much they ran on different days. They each ran for $N$ days — on the $i^{th}$ day, Alice ran $A_i$ meters and Bob ran $B_i$ meters. On each day, - Alice is *unhappy* if Bob ran **strictly more than twice** her distance, and *happy* otherwise. - Similarly, Bob is *unhappy* if Alice ran **strictly more than twice** his distance,
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