반응형 백준 문제풀이184 baekjoon - python - 11650 www.acmicpc.net/problem/11650 11650번: 좌표 정렬하기 첫째 줄에 점의 개수 N (1 ≤ N ≤ 100,000)이 주어진다. 둘째 줄부터 N개의 줄에는 i번점의 위치 xi와 yi가 주어진다. (-100,000 ≤ xi, yi ≤ 100,000) 좌표는 항상 정수이고, 위치가 같은 두 점은 없다. www.acmicpc.net # @Author YoungMinKim # baekjoon import sys N = int(sys.stdin.readline()) tmp = [] for _ in range(N): x,y = map(int,sys.stdin.readline().split()) tmp.append((x,y)) result = sorted(tmp) for i,j in resul.. 2020. 9. 13. baekjoon - python - 11399 www.acmicpc.net/problem/110399 # @Author YoungMinKim # baekjoon import sys N = int(sys.stdin.readline()) x = list(sys.stdin.readline().split()) tmp = list(map(int,x)) tmp = sorted(tmp) hap = 0 result = [] for i in tmp: hap+=i result.append(hap) print(sum(result)) 2020. 9. 13. baekjoon - python - 11050 www.acmicpc.net/problem/11050 11050번: 이항 계수 1 첫째 줄에 \(N\)과 \(K\)가 주어진다. (1 ≤ \(N\) ≤ 10, 0 ≤ \(K\) ≤ \(N\)) www.acmicpc.net # @Author YoungMinKim # baekjoon def factorial(N): if N == 1: return 1 elif N == 0: return 1 else: return N*factorial(N-1) N,K = map(int,input().split()) print(int(factorial(N)/(factorial(N-K)*factorial(K)))) 2020. 9. 13. baekjoon - python - 11022 www.acmicpc.net/problem/11022 11022번: A+B - 8 각 테스트 케이스마다 "Case #x: A + B = C" 형식으로 출력한다. x는 테스트 케이스 번호이고 1부터 시작하며, C는 A+B이다. www.acmicpc.net # @Author YoungMinKim # baekjoon T= int(input()) for i in range(T): a,b = map(int,input().split()) print("Case #{}: {} + {} = {}".format(i+1,a,b,a+b)) 2020. 9. 13. baekjoon - python - 11021 www.acmicpc.net/problem/11021 11021번: A+B - 7 각 테스트 케이스마다 "Case #x: "를 출력한 다음, A+B를 출력한다. 테스트 케이스 번호는 1부터 시작한다. www.acmicpc.net # @Author YoungMinKim # baekjoon T= int(input()) for i in range(T): a,b = map(int,input().split()) print("Case #{}: {}".format(i+1,a+b)) 2020. 9. 13. baekjoon - python - 11004 www.acmicpc.net/problem/11004 11004번: K번째 수 수 N개 A1, A2, ..., AN이 주어진다. A를 오름차순 정렬했을 때, 앞에서부터 K번째 있는 수를 구하는 프로그램을 작성하시오. www.acmicpc.net # @Author YoungMinKim # baekjoon import sys N,K = sys.stdin.readline().split() ls = list(sys.stdin.readline().split()) result = list(map(int,ls)) result = sorted(result) print(result[int(K)-1]) 2020. 9. 13. 이전 1 ··· 10 11 12 13 14 15 16 ··· 31 다음 반응형