[백준] 19236번 - 청소년 상어 (파이썬)
# 청소년 상어 import copy dx = [0, -1, -1, 0, 1, 1, 1, 0, -1] dy = [0, 0, -1, -1, -1, 0, 1, 1, 1] arr = [] fish = [[0]] for k in range(4): temp = list(map(int, input().split())) arr.append([temp[i] for i in range(0, len(temp), 2)]) for i in range(0, len(temp), 2): fish.append([temp[i], [k, i//2, temp[i+1]]]) def fish_move(arr, fish): for i, temp in enumerate(fish): if i != 0: x, info = temp if not ea..
2022. 3. 12.
[백준] 17822번 - 원판 돌리기 (파이썬)
# 원판 돌리기 from collections import deque import sys intput = sys.stdin.readline N, M, T = map(int, input().split()) dx = [0, 1, 0, -1] dy = [1, 0, -1, 0] arr = [] for _ in range(N): arr.append(deque(map(int, input().split()))) order = [] for _ in range(T): order.append(list(map(int, input().split()))) def rolling(n, dir): for x in range(n, N+1, n): if dir == 0: temp = arr[x-1].pop() arr[x-1].appen..
2022. 3. 8.