https://www.codetree.ai/missions/2/problems/conveyor-belt/description
코드트리 | 코딩테스트 준비를 위한 알고리즘 정석
국가대표가 만든 코딩 공부의 가이드북 코딩 왕초보부터 꿈의 직장 코테 합격까지, 국가대표가 엄선한 커리큘럼으로 준비해보세요.
www.codetree.ai
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 |