https://www.codetree.ai/missions/2/problems/conveyor-belt/description
import sys
from collections import deque
input = sys.stdin.readline
n, t = map(int, input().rstrip().split(" "))
graph = []
for i in range(2):
temp = list(map(int, input().rstrip().split(" ")))
graph.append(temp)
for k in range(t):
temp = [x[-1] for x in graph]
for i in range(2):
for j in range(n-1, 0, -1):
graph[i][j] = graph[i][j-1]
graph[0][0] = temp[-1]
graph[1][0] = temp[0]
for row in graph:
print(*row)
728x90
반응형
'🔻PS > Codetree' 카테고리의 다른 글
[Codetree] 1차원 젠가 Python (0) | 2024.07.28 |
---|---|
[Codetree] 삼각형 컨베이어 벨트 Python (0) | 2024.07.27 |
[Codetree] 행복한 수열의 개수 Python (1) | 2024.07.23 |
[Codetree] 최고의 33위치 Python (1) | 2024.07.23 |
[Codetree] 뿌요뿌요 Python (0) | 2024.07.19 |