| 일 | 월 | 화 | 수 | 목 | 금 | 토 | 
|---|---|---|---|---|---|---|
| 1 | ||||||
| 2 | 3 | 4 | 5 | 6 | 7 | 8 | 
| 9 | 10 | 11 | 12 | 13 | 14 | 15 | 
| 16 | 17 | 18 | 19 | 20 | 21 | 22 | 
| 23 | 24 | 25 | 26 | 27 | 28 | 29 | 
| 30 | 
                                        Tags
                                        
                                    
                                        
                                    - 백준
 - matrixElementsSum
 - flask
 - All Longest Strings
 - adjacentElementsProduct
 - codesignal
 - markdown
 - collections.deque
 - almostIncreasingSequence
 - Daily Commit
 - data_structure
 - 피보나치 수
 - shapeArea
 - C++
 - 파이썬 포렌식
 - 수 정렬하기
 - baekjun
 - Python
 - recursion
 - cpp
 - Counting cells in a blob
 - codesingal
 - 2015 봄학기 알고리즘
 - Numpy
 - 파이썬머신러닝완벽가이드
 - centuryFromYear
 - 2750
 - til
 - Sequential Search
 - 10953
 
                                        Archives
                                        
                                    
                                        
                                    - Today
 
- Total
 
Introfor
[백준] 2480번 주사위 세개 본문
입력 받은 3개의 수를 오름차순 정렬하고 set()을 이용하여 개수를 통해 문제를 풀었다.
저번에 주사위 네개를 풀어서 같은 방식으로 풀었다.
| 
 1 
2 
3 
4 
5 
6 
7 
8 
9 
10 
11 
12 
 | 
 def solution() -> int: 
    dice = sorted(map(int, input().split())) 
    if len(set(dice)) == 1: 
        return 10000 + dice[0] * 1000 
    if len(set(dice)) == 3: 
        return dice[2] * 100 
    for i in range(2): 
        if dice[i] == dice[i+1]: return 1000+dice[i]*100 
res = solution() 
print(res) 
 | 
cs | 
'Programming_prob > BaekJoon' 카테고리의 다른 글
| [백준] 3004번 체스판 조각 (0) | 2020.10.19 | 
|---|---|
| [백준] 2525번 오븐 시계 (0) | 2020.10.19 | 
| [백준] 1978번 소수 찾기 (0) | 2020.10.10 | 
| [백준] 2839번 설탕 배달 (0) | 2020.10.09 | 
| [백준] 1712번 손익분기점 (0) | 2020.10.08 | 
                          Comments