aboutsummaryrefslogtreecommitdiff
path: root/2025/11/b.py
blob: 8fdcc8b4ac5192d7c775d1b55c347e059d3c69a2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import fileinput
from functools import cache

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

@cache
def np(v, d, f):
	if v == 'out':
		return 1 if d and f else 0
	return sum(np(w, d or v == 'dac', f or v == 'fft') for w in a[v])

print(np('svr', False, False))

Generated with cgit - Back to sebastiano.tronto.net