지도에서 상하좌우 움직이기
def isOut(x, y): if N >= x > 0 and N >= y > 0 : # print(False) return False # print(True) return True def doAction(action) : global x, y, nx, ny nx = x ny = y if action == "R" : nx +=1 if action == "U" : ny -=1 if action == "D" : ny +=1 if isOut(nx, ny): # print("out", nx, ny) return x, y = nx, ny if __name__=="__main__": # plans = input().split() plans = ['R', 'R', 'R', 'U', 'D', 'D'] N = 5 x, ..
2022. 8. 27.