31901 [백준 3190번] 뱀 from collections import deque n = int(input()) k = int(input()) area = [[0]*n for _ in range(n)] direction_list = [] time = 0 for _ in range(k): r,c = map(int,input().split()) area[r-1][c-1] = 1 l = int(input()) for _ in range(l): x, c = input().split() direction_list.append((int(x),c)) x, y = 0, 0 direction = "R" tail = deque([(0,0)]) index = 0 while 1: area[x][y] = -1 if time == direction_list.. 2023. 8. 6. 이전 1 다음