(softeer) 로봇이 지나간 길
import sys def start(y, x): global maxx, maxy, direc, direcnum #4구석탱이인 경우나 하나 구석인 경우나 4면 다 뚫린 경우 dx = [1, 0, -1, 0] dy = [0, 1, 0, -1] cnt, dirr = 0, 0 for i in range(4): nx, ny = x + dx[i], y + dy[i] if nx = maxy or nx >= maxx: continue if mp[ny][nx] == '#': cnt = cnt+1 dirr = i if cnt == 1: if dirr == 0 : direc, direcnum = '>', 0 elif dirr == 1: direc, direcnum = 'v', 1 el..
[Softeer] 금고 관리
import sys # 70*2 + 30*1 = 170, 자를 수 있다. 따라서 챙길 수 있는 것중 가장 비싼건 무조건 챙겨야됨. input = sys.stdin.readline wgt, cnt = map(int, input().split()) lst = [] lst = [list(map(int, input().split())) for _ in range(cnt)] # for i in range(cnt): # much, price = map(int, input().split()) # lst.append((price, much)) lst.sort(key = lambda x : x[1], reverse=True) posb, curprice, idx = wgt,0, 0 while posb > 0: if pos..