1823: 【CSP数组】扑克牌组合█

Memory Limit:128 MB Time Limit:1.000 S
Judge Style:Text Compare Creator:
Submit:8 Solved:2

Description

小明从一副扑克牌中(没有大小王, lns="http://www.w3.org/1998/Math/MathML">J 认为是数字 lns="http://www.w3.org/1998/Math/MathML">11  lns="http://www.w3.org/1998/Math/MathML">Q  lns="http://www.w3.org/1998/Math/MathML">12  lns="http://www.w3.org/1998/Math/MathML">K  lns="http://www.w3.org/1998/Math/MathML">13  lns="http://www.w3.org/1998/Math/MathML">A  lns="http://www.w3.org/1998/Math/MathML">1 )抽出 lns="http://www.w3.org/1998/Math/MathML">2 张牌求和,请问能够组合出多少个不相等的数,按照由小到大输出这些数。

Input

第一行是一个整数 lns="http://www.w3.org/1998/Math/MathML">n 代表( lns="http://www.w3.org/1998/Math/MathML">n52 )扑克牌的总数量;

第二行的 lns="http://www.w3.org/1998/Math/MathML">n 个整数分别代表扑克牌的数值。

Output

第一行是一个整数 lns="http://www.w3.org/1998/Math/MathML">m 代表组合出不相等的数字个数;

第二行 lns="http://www.w3.org/1998/Math/MathML">m 个数用空格隔开代表这 lns="http://www.w3.org/1998/Math/MathML">m 个由小到大排序的不相等的数。

Sample Input Copy

4
3 1 2 4

Sample Output Copy

5
3 4 5 6 7