boj step 4 rework

This commit is contained in:
2024-02-19 13:23:50 +09:00
parent e39d555bd0
commit bad1f0723a
5 changed files with 44 additions and 0 deletions

View File

@@ -0,0 +1,7 @@
N, M = map(int, input().split())
L = [i + 1 for i in range(N)]
for _ in range(M):
i, j = map(int, input().split())
L[i - 1:j] = reversed(L[i - 1:j])
print(" ".join(map(str, L)))