본문 바로가기
반응형

백준 문제풀이184

baekjoon - python - 1010 www.acmicpc.net/problem/1010 1010번: 다리 놓기 입력의 첫 줄에는 테스트 케이스의 개수 T가 주어진다. 그 다음 줄부터 각각의 테스트케이스에 대해 강의 서쪽과 동쪽에 있는 사이트의 개수 정수 N, M (0 < N ≤ M < 30)이 주어진다. www.acmicpc.net # @Author YoungMinKim # baekjoon import sys import math def combinations_len(p,r): return math.factorial(p)/(math.factorial(r)*math.factorial(p-r)) for _ in range(int(sys.stdin.readline())): N,M = map(int,sys.stdin.readline().split.. 2020. 12. 20.
baekjoon - python - 6768 www.acmicpc.net/problem/6768 6768번: Don’t pass me the ball! A CCC soccer game operates under slightly different soccer rules. A goal is only counted if the 4 players, in order, who touched the ball prior to the goal have jersey numbers that are in strictly increasing numeric order with the highest number being the www.acmicpc.net 이 문제는 경우의 수 문제이다. 오랜만에 수학을 풀려니 힘들어서 적어본다.. 숫자카드 조합 문제를 중고등학교 때 많이 .. 2020. 12. 19.
baekjoon - python - 5575 www.acmicpc.net/problem/5575 5575번: 타임 카드 JOI 상사는 직원의 근무시간을 타임 카드로 관리하고있다. 직원들은 전용 장비를 사용하여 타임 카드에 출근 시간을 기록한다. 근무를 마치고 퇴근할 때도 타임 카드에 퇴근 시간을 기록한다. www.acmicpc.net # @Author YoungMinKim # baekjoon import sys import datetime a = list(map(int,sys.stdin.readline().split())) b = list(map(int,sys.stdin.readline().split())) c = list(map(int,sys.stdin.readline().split())) def convert_timedelta(duration).. 2020. 12. 8.
baekjoon - python - 1297 www.acmicpc.net/problem/1297 1297번: TV 크기 첫째 줄에 TV의 대각선 길이, TV의 높이 비율, TV의 너비 비율이 공백 한 칸을 사이에 두고 주어진다. 대각선 길이는 5보다 크거나 같고, 1,000보다 작거나 같은 자연수, 높이 비율은 1보다 크거나 같 www.acmicpc.net import sys import math a,b,c = map(int,sys.stdin.readline().split()) x = math.pow(b,2)+math.pow(c,2) y = math.pow(a,2)/x print(int(math.sqrt(y)*b),int(math.sqrt(y)*c)) with 피타고라스 정리 2020. 12. 7.
baekjoon - python - 2566 www.acmicpc.net/problem/2566 2566번: 최댓값 첫째 줄에 최댓값을 출력하고, 둘째 줄에 최댓값이 위치한 행 번호와 열 번호를 빈칸을 사이에 두고 차례로 출력한다. 최댓값이 두 개 이상인 경우 그 중 한 곳의 위치를 출력한다. www.acmicpc.net import sys block = [] for _ in range(9): x = list(map(int,sys.stdin.readline().split())) block.append(x) maximum = max(sum(block,[])) print(maximum) row = 1 breaker=False for i in block: col = 1 for j in i: if j == maximum: print(row,col) bre.. 2020. 12. 6.
baekjoon - python - 5597 www.acmicpc.net/problem/5597 # @Author YoungMinKim # baekjoon import sys dic = {} for i in range(1,31): dic[i] = 1 for j in range(28): x = int(sys.stdin.readline()) if x in dic: dic[x]=2 result = sorted(dic.items(),key=(lambda x: x[0])) for i in result: if i[1] == 1: print(i[0]) 2020. 12. 6.
반응형