프로그램 명: coci_kompici
제한시간: 1 초
[문제요약]
1 에서 10^18 이하인 수 들이 주어질 때 두 수 중 같은 숫자를 포함(같은 위치일 필요는 없다)하고 있으면 이 두수를 pals 라고 한다.
pals 의 개수를 구하는 것이 문제이다.
After successfully solving his math homework from the previous task, Mirko has become bored, so he
has made a list of N large integers. On the list there are some pairs of numbers that he likes, and some
pairs he doesn’t like.
Mirko has named the pairs that he likes pals. Two numbers are pals if they have at least one digit in
common (not necessarily in the same position).
Help Mirko count how many pairs of numbers in his list are pals.
입력
The first line of input contains the positive integer N (1 ≤ N ≤ 1 000 000).
Each of the next N lines contains a positive integer from the range [1, 10^18], a number from Mirko’s
list. No two numbers in the list will be equal.
출력
The first and only line of output must contain the number of pairs that are pals.
입출력 예
input
3
4
20
44
output
1
input
4
32
51
123
282
output
4
출처:coci
[질/답]
[제출 현황]
[푼 후(0)]