알고리즘/배열(array)
백준 10811 python
자코린이
2023. 6. 13. 22:36
list_count, input_int = list(map(int, input().split()))
bucket = [i for i in range(1,list_count + 1)]
after_bucket = []
for _ in range(input_int):
a, b = list(map(int, input().split()))
after_bucket = list(reversed(bucket[a-1:b]))
bucket[a-1:b] = after_bucket
print(' '.join(str(e) for e in bucket))