본문 바로가기
Beakjoon&프로그래머스/파이썬

[백준/파이썬] 29064번 Обучение войск

by 현장 2023. 12. 15.

-Code

from math import ceil

n = int(input())
soldiers = list(map(int, input().split()))
train = soldiers.count(1)
half = ceil(len(soldiers) / 2)

res = half - train

print(max(res, 0))