Relocation
This commit is contained in:
8
relocation.py
Normal file
8
relocation.py
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
n, q = map(int, input().split())
|
||||||
|
c = {x: y for x, y in enumerate(list(map(int, input().split())), start=1)}
|
||||||
|
for _ in range(q):
|
||||||
|
t, a, b = map(int, input().split())
|
||||||
|
if t == 1:
|
||||||
|
c[a] = b
|
||||||
|
elif t == 2:
|
||||||
|
print(abs(c[a] - c[b]))
|
||||||
Reference in New Issue
Block a user