Kompići
의견: 0
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 \le N \le 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.
| 서브태스크 | 점수 | 설명 |
|---|---|---|
Test 1 | 10점 | None |
Test 2 | 10점 | None |
Test 3 | 10점 | None |
Test 4 | 10점 | None |
Test 5 | 10점 | None |
Test 6 | 10점 | None |
Test 7 | 10점 | None |
Test 8 | 10점 | None |
Test 9 | 10점 | None |
Test 10 | 10점 | None |
3
4
20
4414
32
51
123
2824평가 및 의견
Kompići
아직 의견이 없습니다. 자격이 된다면 위 양식에서 가장 먼저 평가해 보세요.
풀이 제출
Kompići