-
[python]백준 카트라이더: 드리프트 27522번알고리즘 문제풀이/백준(파이썬) 2023. 5. 3. 22:59
코드
import sys sys.stdin = open("27522.txt", "r") q=[] for _ in range(8): a=input().split() q.append(a) q.sort() s1=0#점수 s2=0#점수 #1등,2등,3등 if q[0][1]=="B": s1+=10 else: s2+=10 if q[1][1]=="B": s1+=8 else: s2+=8 if q[2][1]=="B": s1+=6 else: s2+=6 #4등~8등 for i in range(3,8): if q[i][1]=="B": s1+=8-i#점수5,4,3,2,1 else: s2+=8-i#점수5,4,3,2,1 if s1<s2: print('Red') else: print('Blue')
링크
https://www.acmicpc.net/problem/27522
'알고리즘 문제풀이 > 백준(파이썬)' 카테고리의 다른 글
[python]백준 2009년 2948번 (0) 2023.05.04 [python]백준 2007년 1924번 (0) 2023.05.04 [python]백준 가희와 열리지 않는 건널목 27885번 (0) 2023.05.02 [python]백준 화성 수학 5355번 (0) 2023.05.01 [python]백준 진짜 공간 1350번 (0) 2023.04.30