CF305A.Strange Addition

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

Unfortunately, Vasya can only sum pairs of integers ( aa , bb ), such that for any decimal place at least one number has digit 00 in this place. For example, Vasya can sum numbers 505505 and 5050 , but he cannot sum 11 and 44 .

Vasya has a set of kk distinct non-negative integers d1,d2,...,dkd_{1},d_{2},...,d_{k} .

Vasya wants to choose some integers from this set so that he could sum any two chosen numbers. What maximal number of integers can he choose in the required manner?

输入格式

The first input line contains integer kk (1<=k<=100)(1<=k<=100) — the number of integers.

The second line contains kk distinct space-separated integers d1,d2,...,dkd_{1},d_{2},...,d_{k} (0<=di<=100)(0<=d_{i}<=100) .

输出格式

In the first line print a single integer nn the maximum number of the chosen integers. In the second line print nn distinct non-negative integers — the required integers.

If there are multiple solutions, print any of them. You can print the numbers in any order.

输入输出样例

  • 输入#1

    4
    100 10 1 0
    

    输出#1

    4
    0 1 10 100 
  • 输入#2

    3
    2 70 3
    

    输出#2

    2
    2 70 
首页