-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))
'Beakjoon&프로그래머스 > 파이썬' 카테고리의 다른 글
[백준/파이썬] 30957번 빅데이터 vs 정보보호 vs 인공지능 (0) | 2023.12.17 |
---|---|
[백준/파이썬] 24387번 HONEY BEE EXHIBITION (0) | 2023.12.16 |
[백준/파이썬] 30655번 Pique Esconde (0) | 2023.12.14 |
[백준/파이썬] 14075번 Luhn (0) | 2023.12.13 |
[백준/파이썬] 30889번 좌석 배치도 (0) | 2023.12.11 |