Agorithm/백준 알고리즘
백준 알고리즘 1296번 데이트(python)
kimjinho1
2021. 2. 15. 00:09
728x90
반응형
단순 구현 문제이다.
ms = input()
n = int(input())
li = sorted([input() for i in range(n)])
max_p = max_i = 0
for i in range(n):
L = ms.count("L") + li[i].count("L")
O = ms.count("O") + li[i].count("O")
V = ms.count("V") + li[i].count("V")
E = ms.count("E") + li[i].count("E")
p = ((L+O)*(L+V)*(L+E)*(O+V)*(O+E)*(V+E)) % 100
if max_p < p:
max_p = p
max_i = i
print(li[max_i])
728x90
반응형