시뮬레이션

14890번 – 경사로

1

문제 풀이 코드 from copy import deepcopy n, l = map(int, input().split()) board = [list(map(int, input().split())) for _ in range(n)] height, width, RIGHT, LEFT, 경사로 = (n, n, 1, -1, '#') record = [[0]*width for _ in range(height)] def 보드돌리기(board): B = [[0]*width for _ in range(height)] for x in range(width): for y in range(height): B[x][y] = board[y][x] return B def 경사로를놓을수있는가(board, y, fromX, toX...

15685번 – 드래곤 커브

1

문제 풀이 코드 from copy import deepcopy n = int(input()) curves = [list(map(int, input().split())) for _ in range(n)] board = [[0]*102 for _ in range(102)] dyx = [(0, 1), (-1, 0), (0, -1), (1, 0)] rotate = [1, 2, 3, 0] def findSquares(): count = 0 dyx = [(0, 1), (1, 0), (1, 1)] for y in range(len(board)): for x in range(len(board[y])): if board[y][x] == 1: hasSquare = True for dy, dx in dyx: _y, _x =...

3190번 – 뱀

3

문제 풀이 코드 from collections import deque n = int(input()) k = int(input()) board = [[0]*n for _ in range(n)] 사과, 벽 = ('A', '#') for _ in range(k): y, x = list(map(int, input().split())) board[y-1][x-1] = 사과 board = [[벽]*n] + board + [[벽]*n] height, width = (n+2, n+2) for y in range(height): board[y] = [벽] + board[y] + [벽] L = int(input()) moves = deque([list(map(str, input().split())) for _ in...