본문 바로가기
python-algorithm

[백준] 10811

by 무적김두칠 2021. 1. 11.

1
2
3
4
5
6
7
import sys
n,m=map(int, sys.stdin.readline().split())
tmp=[i+1 for i in range(n)]
for _ in range(m):
    a,b=map(int,sys.stdin.readline().split())
    tmp[a-1:b]=tmp[a-1:b][::-1]
print(*tmp)
cs
반응형

'python-algorithm' 카테고리의 다른 글

[백준] 10813  (0) 2021.01.11
[백준] 10812  (0) 2021.01.11
[백준] 10810  (0) 2021.01.11
[백준] 10809  (0) 2021.01.11
[백준] 10808  (0) 2021.01.11

댓글