본문 바로가기
python-algorithm

[백준] 1267

by 무적김두칠 2020. 12. 17.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
import sys
n=int(sys.stdin.readline())
tmp=list (map(int, sys.stdin.readline().split()))
youn=0
mins=0
for i in range(n):
    if tmp[i]<30: youn+=10
    else : youn+= (tmp[i]//30 + 1)*10
    if tmp[i]<60: mins+=15
    else : mins+= (tmp[i]//60 + 1)*15
 
if youn> mins : print("M %d"%mins)
if youn== mins : print("Y M %d"%mins)
if youn< mins : print("Y %d"%youn)
cs
반응형

'python-algorithm' 카테고리의 다른 글

[백준] 1703  (0) 2020.12.17
[백준] 1598  (0) 2020.12.17
[백준] 1247  (0) 2020.12.17
[백준] 1085  (0) 2020.12.17
[백준] 19944  (0) 2020.12.17

댓글