ответ:
n, m, t = map(int,
x = list(map(int,
def build(name):
if name in built:
pass
elif b[a.index(name)] == ["0"]:
built.append(name)
else:
for i in b[a.index(: ]:
if i not in built:
build(i)
built.append(name)
a = []
b = []
built = []
for i in range(0, n):
a.append(
b.append(
for i in range(0, b.:
built.append(a[b.
a.pop(b.
b.pop(b.
[build(str(o)) for o in x]
print(len(built))
объяснение:
n, m, t = map(int, input().split())
x = list(map(int, input().split()))
def build(name):
if name in built:
pass
elif B[A.index(name)] == ["0"]:
built.append(name)
else:
for i in B[A.index(name)][1:]:
if i not in built:
build(i)
built.append(name)
A = []
B = []
built = []
for i in range(0, n):
A.append(input())
B.append(input().split())
for i in range(0, B.count([])):
built.append(A[B.index([])])
A.pop(B.index([]))
B.pop(B.index([]))
[build(str(o)) for o in x]
print(len(built))
Объяснение:
htt ps://pastebin. com/cNBHaZJM
1)
a = int(input())
b = int(input())
c = (a**2+b**2)**0.5
print(f'Периметр равен: {a+b+c}')
2)
n = int(input())
lst = [64, 32, 16, 8, 4, 2, 1]
ans = []
while n>0:
for i in lst:
if n >= i:
n -= i
ans.append(i)
break
print(f'Понадобится {len(ans)}шт. купюр, а именно:')
print(*ans)