백준 10804번: 카드 역배치 #Python

ColorlessDia·2024년 4월 26일

algorithm/baekjoon

목록 보기
157/818
card_list = list(range(20 + 1))

for _ in range(10):
    a, b = map(int, input().split())

    card_list = card_list[:a] + card_list[a:b + 1][::-1] + card_list[b + 1:]

print(*card_list[1:])

0개의 댓글