aoc2021/d14/dograph.py

9 lines
219 B
Python
Raw Normal View History

2022-01-02 22:35:19 +00:00
import sys
L = sys.stdin.read().splitlines()
L = L[2:]
L = [ l.split() for l in L ]
D = { tuple(k):v for [k,_,v] in L }
print('digraph G {')
for ((k,l),v) in D.items():
print(f'{k} -> {v} [label="{l}"];')
print("}")