题号:NC25133
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 32 M,其他语言64 M
64bit IO Format: %lld
题目描述
有T种馅料,但有些馅料不能被放在一起。求选出一些馅料的方案数是多少。
文件输入第一行为两个整数 T 和 N(

),N表示接下来N行会有N个限制。
接下来N行,每行的第一个数Z表示接下来数的个数:a1,a2......az,表示任意一种陷料中这z种馅料不能同时出现。
如果Z=1,则表示a1 这种陷料在任何一种组合中都不得出现。
如果Z=3 a1=3 a2=4 a3=6 表示3,4,6 三种馅料不能在任何一种组合中出现。
输入描述:
Line 1: Two space-separated integers: T and N
Lines 2..N+1: Each line describes a constraint using space-separated
The first integer is the number of ingredients in constraint, Z (1 <= Z <= T). The subsequent Z integers (which are unique) list the ingredient(s) whose combination a pizza from consideration for the cows.
输出描述:
Line 1: A single integer that is the total number of pizzas that can be created using the number of ingredients and constraints.
示例1
输入
复制
6 5
1 1
2 4 2
3 3 2 6
1 5
3 3 4 6