Army Training
Chef is a high-ranked army officer and he has been given the job to train the army. The army consists of $N$ soldiers where each soldier has $3$ parameters: - *Attack points*: $A_i$ where $(0\lt A_i \lt 1000)$; - *Defense points*: $(1000-A_i)$; - *Soldier type*: `ATTACK` or `DEFENSE`. For the whole army: - *Attack value* of the army is defined as the **sum** of *attack points* of all `ATTACK` ty
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