Programming [Python] (411) 썸네일형 리스트형 #194 백준 파이썬 [10953] A+B - 6 https://www.acmicpc.net/problem/10953 #Solution T = int(input()) for _ in range(T): A, B = map(int, input().split(',')) print(A+B) #193 백준 파이썬 [2004] 조합 0의 개수 https://www.acmicpc.net/problem/2004 #Solution 10은 2와 5로 구성된다. 따라서 nCm 내에 있는 2와 5 중 최소값이 무엇인지 알아낸 뒤 출력하면 된다. #n!의 5 개수 세는 함수 def five_count(n): answer = 0 while n != 0: n = n // 5 answer += n return answer #n!의 2 개수 세는 함수 def two_count(n): answer = 0 while n != 0: n = n // 2 answer += n return answer n, m = map(int, input().split()) if m == 0: print(0) else: print(min(two_count(n)-two_count(m)-t.. #192 백준 파이썬 [2752] 세수정렬 https://www.acmicpc.net/problem/2752 #Solution numbers = list(map(int, input().split())) numbers.sort() print(numbers[0], numbers[1], numbers[2]) #191 백준 파이썬 [10870] 피보나치 수 5 https://www.acmicpc.net/problem/10870 #Solution def fibonacci(n): answer = 0 temp_1 = 1 temp_2 = 1 for i in range(1, n+1): if i == 1: answer = temp_1 elif i == 2: answer = temp_2 else: answer = temp_1 + temp_2 temp_1 = temp_2 temp_2 = answer print(answer) fibonacci(int(input())) #190 백준 파이썬 [11557] Yangjojang of The Year https://www.acmicpc.net/problem/11557 #Solution 연세대의 편향된 예시다. T = int(input()) for _ in range(T): N = int(input()) alcohol = [] for _ in range(N): S, L = map(str, input().split()) alcohol.append([S,int(L)]) alcohol = sorted(alcohol, key = lambda x: x[1]) print(alcohol[-1][0]) #189 백준 파이썬 [9506] 약수들의 합 https://www.acmicpc.net/problem/9506 #Solution 100,000 이하의 완전수는 4개 밖에 존재하지 않는다. 이 것이 바로 선진 코딩 perfect_num = {6 : "6 = 1 + 2 + 3", 28 : "28 = 1 + 2 + 4 + 7 + 14", 496: "496 = 1 + 2 + 4 + 8 + 16 + 31 + 62 + 124 + 248", 8128 : "8128 = 1 + 2 + 4 + 8 + 16 + 32 + 64 + 127 + 254 + 508 + 1016 + 2032 + 4064"} num = int(input()) while num != -1: if num in perfect_num: print(perfect_num[num]) else: print(".. #188 백준 파이썬 [10214] Baseball - 고연전 https://www.acmicpc.net/problem/10214 #Solution T = int(input()) for _ in range(T): Y = K = 0 for _ in range(9): y, k = map(int, input().split()) Y += y K += k if Y > K: print('Yonsei') elif Y < K: print('Korea') else: print("Draw") #187 백준 파이썬 [10103] 주사위 게임 https://www.acmicpc.net/problem/10103 #Solution n = int(input()) x = y = 100 for _ in range(n): a, b = map(int, input().split()) if a > b: y -= a elif a < b: x -= b print(x, y, sep = "\n") 이전 1 ··· 25 26 27 28 29 30 31 ··· 52 다음