PS/Python
[BOJ] 14503 - 로봇 청소기
구현 문제. 차근차근 구현하면 어렵지 않다. 스택을 사용할 필요는 없는데 머리에서 그려보기 편해서 써봤다. from sys import stdin R, C = map(int, stdin.readline().split()) r, c, d = map(int, stdin.readline().split()) arr = [list(map(int, stdin.readline().split())) for x in range(R)] visited = [[0]*C for x in range(R)] # 'left', 'bottom', 'right', 'up' head = [(0,-1), (1,0), (0,1), (-1,0)] # 바라보는 방향 init idx_head = 3 - d result = 0 stack = [(r..
2021. 9. 18. 14:28
최근댓글