act[s[i % n]].update({s[(j + i) % n] for j in range(1, n)})
это "b", а act[s[i % n]] = {s[(j + i) % n] for j in range(1, n)}
это "c" в вашем коде ? :b = {i % 100 for i in range(100)}
c = {(i + j) % 100 for i in range(100) for j in range(100)}
c.difference(b)
set()
d = {}
first=list(map(int,input().split()))
n,k=first[0],first[1]
for i in range(n):
point=list(map(int,input().split()))
x=point[0]
y=point[1]
d[x,y] = [(x-1,y), (x+1, y), (x, y-1), (x, y+1)]
print(d)
def Dijkstra(N, S, matrix):
valid = [True]*N
weight = [1000000]*N
weight[S] = 0
for i in range(N):
min_weight = 1000001
ID_min_weight = -1
for i in range(len(weight)):
if valid[i] and weight[i] < min_weight:
min_weight = weight[i]
ID_min_weight = i
for i in range(N):
if weight[ID_min_weight] + matrix[ID_min_weight][i] < weight[i]:
weight[i] = weight[ID_min_weight] + matrix[ID_min_weight][i]
valid[ID_min_weight] = False
return weight