Ghost Leg

This commit is contained in:
2023-07-02 20:30:12 +02:00
parent edde2f011b
commit 3f3718d093

15
ghostleg.py Normal file
View File

@@ -0,0 +1,15 @@
n, m = map(int, input().split())
rungs = [int(input()) for _ in range(m)]
res = [
0,
] * n
for element in range(1, n + 1):
pos = element
for r in rungs:
if pos == r:
pos += 1
elif pos == r + 1:
pos -= 1
res[pos - 1] = element
print("\n".join(map(str, res)))