[백준] 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.
[프로그래머스] 고득점Kit (5) - 완전탐색 (파이썬)
1. 모의고사 (Lv. 1) # 모의고사 def solution(answers): answer = [] one = [1, 2, 3, 4, 5] two = [2, 1, 2, 3, 2, 4, 2, 5] thr = [3, 3, 1, 1, 2, 2, 4, 4, 5, 5] one = one*(len(answers)//len(one)) + one[:(len(answers) % len(one))] two = two*(len(answers)//len(two)) + two[:(len(answers) % len(two))] thr = thr*(len(answers)//len(thr)) + thr[:(len(answers) % len(thr))] result = [0, 0, 0] for i in range(len(answe..
2022. 3. 4.