atocoder復習
解けなかった問題の復習
問題①
解答コード
def answer1():
n, m = map(int, input().split())
al = [[False]*n for _ in range(n)]
print(f'1->:{al}') # [[False, False, False], [False, False, False], [False, False, False]]
for _ in range(m):
xl = list(map(int, input().split()))
k = xl[0]
xl = xl[1:]
print(f'2->:{xl}') # [1, 2], [2, 3], [1, 3]
for x1 in xl:
for x2 in xl:
al[x1-1][x2-1] = True
print(f'3->:{al}') # [[True, True, True], [True, True, True], [True, True, True]]
for i in range(n):
for j in range(n):
if not al[i][j]:
print('No')
exit()
print('Yes')
answer1()
以上になります。