aboutsummaryrefslogtreecommitdiff
path: root/2025/11/a.py
blob: cf06b6a931609e6d2f52a403e24feccdcf161be5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
import fileinput

a = {}
with fileinput.input() as lines:
	for line in lines:
		v, l2 = line[:-1].split(': ')
		a[v] = l2.split(' ')

def np(v):
	return 1 if v == 'out' else sum(np(w) for w in a[v])

print(np('you'))

Generated with cgit - Back to sebastiano.tronto.net