diff --git a/relocation.py b/relocation.py new file mode 100644 index 0000000..89c016f --- /dev/null +++ b/relocation.py @@ -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]))