본문 바로가기

Algorithm475

[파이썬] 백준 - 13단계 정렬 [파이썬] 백준 - 13단계 정렬 수 정렬하기 (2750) N = int(input()) temp = [] for i in range(N): a = int(input()) temp.append(a) temp.sort() for i in temp : print(i) 대표값2 (2587) temp = [] for i in range(5): a = int(input()) temp.append(a) temp.sort() print(int(sum(temp)/5)) print(temp[2]) 커트라인 (25305) N,k = map(int,input().split()) score = list(map(int,input().split())) score.sort() print(score[-k]) 수 정렬하기2 (2751.. 2023. 4. 17.
[파이썬] 백준 - 10단계 기하: 직사각형과 삼각형 [파이썬] 백준 - 10단계 기하: 직사각형과 삼각형 직사각형 (27323) A = int(input()) B = int(input()) print(A*B) 직사각형에서 탈출 (1085) x,y,w,h = map(int,input().split()) temp = [x,y,w-x,h-y] print(min(temp)) 네 번째 점 (3009) temp_x,temp_y = set({}),set({}) given,point = [],[] for i in range(3): x,y = map(int,input().split()) temp_x.add(x) temp_y.add(y) given.append([x,y]) temp_x = list(temp_x) temp_y = list(temp_y) x_min,x_max,.. 2023. 4. 8.
[파이썬] 백준 - 9단계 약수, 배수와 소수 [파이썬] 백준 9단계 - 약수, 배수와 소수 배수와 약수 (5086) while True : a,b = map(int,input().split()) if a==0 and b==0: break else: if b%a == 0 : print('factor') elif a%b==0: print('multiple') else: print('neither') 소수 (2581) M = int(input()) N = int(input()) b = list(range(M,N+1)) prime = [] for i in range(len(b)): # 소수찾는루프 if b[i] == 1 : # 1제외 continue elif b[i] == 2 : # 2예외 prime.append(b[i]) continue else : #.. 2023. 4. 8.
[파이썬] 백준 - 7단계 2차원 배열 [파이썬] 백준 - 7단계 2차원 배열 색종이 (2563) N = int(input()) map_size = 101 length = 10 plane = [] for i in range(map_size): temp = [] for k in range(map_size): temp.append(0) plane.append(temp) for k in range(N): x,y = map(int,input().split()) for i in range(length): for j in range(length): plane[x+i][y+j]=1 count = 0 for i in range(101): count += sum(plane[i]) print(count) 세로읽기 (10798) temp = [] for i in.. 2023. 4. 6.