|
||||||||||
Candidate superkeyTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 180 Accepted Submission(s): 1 Problem Description A database table consists of a set of columns called attributes, and a set of rows called entries. A superkey is a set of attributes such that each entry's values for those attributes forms a unique ordered set. That is, for any superkey, each pair of entries differs in at least one of the attributes contained within the superkey. A candidate superkey is a superkey such that no proper subset of its attributes forms a superkey. (A proper subset of a superkey is a set of attributes that is formed by removing one or more attributes from the superkey.) Input The input file contains several test cases. Each test case begins with two integers n and m ( 2<=n<=30, 1<=m<=10 ), which indicate the size of the table. Then n lines follow, each line contains m uppercase letters ('A'-'Z') to represent one entry. Output For each case, output the number of candidate superkeys of the table. Sample Input
Sample Output
Source | ||||||||||
|