Ghost Leg
This commit is contained in:
15
ghostleg.py
Normal file
15
ghostleg.py
Normal 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)))
|
||||||
Reference in New Issue
Block a user