atcoder#AGC044F. [AGC044F] Name-Preserving Clubs
[AGC044F] Name-Preserving Clubs
Score : points
Problem Statement
There are people (with different names) and clubs. For each club you know the list of members (so you have unordered lists). Each person can be a member of many clubs (and also clubs) and two different clubs might have exactly the same members. The value of the number is the minimum possible such that the following property can be true for at least one configuration of clubs. If every person changes her name (maintaining the property that all names are different) and you know the new lists of members of the clubs (but you don't know which list corresponds to which club), you are sure that you would be able to match the old names with the new ones.
Count the number of such configurations of clubs (or say that there are more than ). Two configurations of clubs that can be obtained one from the other if the people change their names are considered equal.
Formal statement: A club is a (possibly empty) subset of (the subset identifies the members, assuming that the people are indexed by the numbers ). A configuration of clubs is an unordered collection of clubs (not necessarily distinct). Given a permutation of and a configuration of clubs , we denote with the configuration of clubs (if is a club, ). A configuration of clubs is name-preserving if for any pair of distinct permutations , it holds .
You have to count the number of name-preserving configurations of clubs with the minimum possible number of clubs (so is minimum). Two configurations such that (for some permutation ) are considered equal. If there are more than such configurations, print .
Constraints
Input
The input is given from Standard Input in the format
Output
If is the number of configurations with the properties described in the statement, you should print on Standard Output
If there are more than such configurations, print .
2
1
The value of is and the unique name-preserving configuration of clubs is (the configuration is considered the same).
3
1
The value of is and the unique (up to permutation) name-preserving configuration of clubs is .
4
7
The value of is and the name-preserving configurations of clubs with clubs are:
13
6
26
-1
123456789123456789
-1