[백준 1708번] 볼록 껍질 (Python3)
import sys,math input = sys.stdin.readline N = int(input()) point = [] for _ in range(N): x,y = map(int,input().split()) point.append((y,x)) point.sort() cospoint = [] sy,sx = point[0] for i in range(1,N): y,x = point[i] cospoint.append(((sx-x)/math.sqrt((x-sx)**2+(y-sy)**2),x,y)) cospoint.sort() convex = [(sx,sy)] for i in range(N-1): cos,x,y = cospoint[i] while len(convex)>1: x1,y1,x2,y2 = *co..
[백준 2008번] 사다리 게임 (Python3)
import sys input = sys.stdin.readline from heapq import heappush,heappop N,M = map(int,input().split()) #가로 n 세로 m a,b,erase,draw = map(int,input().split()) graph = {(n,m):[((n,m+1),0)] for n in range(1,N+1) for m in range(M+1)} for m in range(M): n = int(input()) graph[(n,m)] = [((n+1,m+1),0),((n,m+1),erase)] graph[(n+1,m)] = [((n,m+1),0),((n+1,m+1),erase)] for n in range(1,N+1): for m in range..