[백준] 17780 - 새로운 게임 (Python)
·
알고리즘 (PS)/BOJ
요구사항에 맞게 구현하면 되는 문제오랜만에 풀어서 그런지 꽤 어려웠다.. 윷놀이 문제처럼 말을 이동하다가 다른 말을 만나면 쌓아야 하는데, 말을 쌓더라도 자신이 갖고있는 방향은 바뀌면 안된다. class Unit: def __init__(self, number, row, col, direction): self.number = number self.row = row self.col = col self.direction = direction def check_next(self): if self.direction == RIGHT: return self.row, self.col + 1 if self.dire..