No.1231 Make a Multiple of Ten
Problem Statement
There are $N$ cards with positive integers written on them, and the $i$-th card has $A_{i}$ written on it.
When choosing cards so that the sum of the integers written on them is a multiple of $10$, find the maximum number of cards that can be chosen.
Note that if not even $1$ card is chosen, the sum is $0$, and this is also considered a multiple of $10$.
Input
$N$
$A_{1}\ A_{2}\ ...\ A_{N}$
・$1\ ≤\ N\ ≤\ 2 \times 10^{5}$
・$1\ ≤\ A_{i}\ ≤\ 10^{9}\ \ (1\ ≤\ i\ ≤\ N)$
・$N, A_{i}$ are integers.
Output
Output on one line the maximum number of cards used when choosing cards so that the sum is a multiple of $10$. Print a newline at the end.
Sample
Sample 1
Input
5 1 3 5 7 9
Output
4
Taking the cards $1, 3, 7, 9$ gives a sum of $20$, which is a multiple of $10$.
Sample 2
Input
9 1 1 1 1 1 1 1 1 1
Output
0
The only way to make the sum a multiple of $10$ is to not take any cards.
Sample 3
Input
10 1 1 1 1 1 1 1 3 7 9
Output
8
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。
MATSUMAT
asdf1