Sword Fight
CodeChefOpen on judge ↗
There are **N** fighters in the field. Power of figher **i** is given by **Pi**. A fight between two fighters **i** and **j** is described as below: The fight lasts till atleast one of them has non zero power left. Each turn is described as below: 1. Fighter i swings his sword if **Pi** is not divisible by 2. 2. Fighter j swings his sword if **Pj** is not divisible by 2. 3. No points are awarded
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