1475번: 방 번호
첫째 줄에 다솜이의 방 번호 N이 주어진다. N은 1,000,000보다 작거나 같은 자연수 또는 0이다.
www.acmicpc.net
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
from math import ceil
n = list(input())
num = []
for i in range(len(n)):
n[i] = int(n[i])
for i in range(10):
num.append(n.count(i))
if num.index(max(num))==6 or num.index(max(num))==9:
print(ceil((num[6]+num[9])/2))
else:
print(max(num))
|
cs |
'백준' 카테고리의 다른 글
백준 10816번: 숫자 카드 2 (0) | 2021.07.19 |
---|---|
백준 1476번: 날짜 계산 (0) | 2021.07.13 |
백준 10814번: 나이순 정렬 (0) | 2021.07.09 |
백준 2941번: 크로아티아 알파벳 (0) | 2021.07.09 |
백준 7287번: 등록 (0) | 2021.07.09 |