我可以在0101的OJ里,刷一整天的题!—— by 仔仔

5886: 【系列题】回溯(九)子集2

Memory Limit:128 MB Time Limit:1.000 S
Judge Style:Text Compare Creator:zhengjh
Submit:0 Solved:0

Description

给你一个长度为 n 的整数数组 a[] ,其中可能包含重复元素,请输出该数组所有可能的子集。

解集 不能 包含重复的子集。从小到大 顺序输出。

Input

第一行一个整数 n。

第二行 n 个整数 a[i]。

Output

该数组所有可能的子集。

按从小到大顺序输出。

每个子集一行。

Sample Input Copy

3
1 2 2

Sample Output Copy

1 
1 2 
1 2 2 
2 
2 2 

HINT

数据范围:

  • 1 <= n<= 10
  • -10 <= a[i] <= 10