A61 - Adjacent Vertices
提出
code: python
n, m = map(int, input().split())
g = {}
for i in range(1, n+1):
for a, b in ab:
print(g)
解答
code: python
N, M = map(int, input().split())
# 隣接リストの作成
for a, b in edges:
# 出力
for i in range(1, N + 1):
output = ''
output += str(i)
output += ': {'
output += ', '.join(map(str, Gi)) # 例えば Gi = { 2, 7, 5 } のとき、ここで "2, 7, 5" という文字列が output の後ろに連結される output += '}'
print(output)