Submit | All submissions | Best solutions | Back to list |
EIUSUBSET - Subset 1 |
Given a set A with N elements.
The first non-empty subset subset of A corresponds to the bit representation of 1 .
The 2nd non-empty subset of A corresponds to the bit representation of 2
…
The Mth non-empty subset of A corresponds to the bit representation of M
For example:
{1} {2} {3}
1 => 0 0 1 => {} {} {3}
2 => 0 1 0 => {} {2} {}
…
(See output for more details)
Input
The first line is N (1<=N<=20)
The next line contains N distinct double a elements of the set. (1<=a<=100)
Output
The first line is M, the number of non-empty subsets
The next m lines are the subsets.
Example
Input:
33 1 2 3
Output:
37 3 2 2 3 1 1 3 1 2 1 2 3
Added by: | Ha Minh Ngoc |
Date: | 2016-04-27 |
Time limit: | 1s-2.5s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: GOSU |