백준 2480번: 주사위 세개💦
·
백준
https://www.acmicpc.net/problem/2480 내 풀이 A, B, C = map(int,input().split()) price = 0 if A != B != C: price = max(A, B, C) * 100 elif A == B != C: price = 1000 + A * 100 elif A != B ==C: price = 1000 + B * 100 elif A == C != B: price = 1000 + A * 100 elif A == B == C: price = 10000 + A*1000 print(price) 정석 풀이 a, b, c = map(int,input().split()) if a == b == c: print(10000+a*1000) elif a == b or ..
백준 2525번: 오븐시계💦
·
백준
https://www.acmicpc.net/problem/2525 내 풀이(오답) A, B = map(int,input().split()) C = int(input()) if C > 59: A += C // 60 if A == 23: A = 0 else: A += 1 B = C % 60 + B if B > 59: B -= 60 elif C 59: B = B + C - 60 if A == 23: A = 0 else: A += 1 elif B + C = 60: #60이 넘어가는 B처리 B -= 60 A += 1 if A >= 24: #24가 넘어가는 A처리 A -= 24 print(A, B) 경우의 수를 찾고 코드가 자꾸 이상하게 길어지다가 결국 구글링...
백준 2884번: 알람 시계
·
백준
https://www.acmicpc.net/problem/2884 내 풀이 H, M = map(int,input().split()) if H > 12: H - 12 alaram = ((H * 60 + M) - 45) # 시간을 분으로 고쳐 합친 다음 45를 빼자! if alaram 23: H1 = H1 - 24 # 다시 시간과 분으로 나누되 시간에서 24이상이 되면 24를 빼도록 설정! M1 = alaram % 60 print(H1, M1) 정석 풀이 H, M = map(int, input().split()) if M < 45 :# 분단위가 45분보다 작을 때 if H ==..
백준 2588번: 곱셈
·
백준
https://www.acmicpc.net/problem/2588 2588번: 곱셈 첫째 줄부터 넷째 줄까지 차례대로 (3), (4), (5), (6)에 들어갈 값을 출력한다. www.acmicpc.net 내 풀이 num1 = int(input()) num2 = int(input()) num_list1 = list(map(int, str(num1))) num_list2 = list(map(int, str(num2))) num_first = print(num1 * num_list2[2]) num_second = print(num1 * num_list2[1]) num_third = print(num1 * num_list2[0]) print(num1*num2) 가장 큰 문제는 input으로 받았을 때 디폴트가..