## 문제
BOJ 2480 주사위 세개
## 풀이
눈 3개가 같은경우 먼저 체크.
눈 2개 같은경우 그다음에 체크.
그다음 마지막 경우 체크하여 상금계산.
## 코드
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tmp = list(map(int,input().split())) | |
tmp.sort() | |
if tmp[0] == tmp[1] and tmp[1] == tmp[2]: | |
ans = tmp[0]*1000 + 10000 | |
elif tmp[0] == tmp[1] or tmp[1] == tmp[2]: | |
ans = tmp[1]*100 + 1000 | |
else: | |
ans = tmp[2]*100 | |
print(ans) |
눈 2개가 같은경우 정렬하면 가운데것만 사용해서 계산 가능하다.
1,2 번이 같은 경우와 2,3 번이 같은경우 1,3 번이 같은 경우를 나눌 필요가 없다는것.
0 댓글