#401
Unrated
Cowpatibility
시간 제한
2s
메모리 제한
1024MB
제출
0
정답
0
맞힌 사람
0
정답 비율
0.0%

문제

It turns out there is one factor that matters far more than any other when determining whether two cows are compatible as potential friends: whether they like similar flavors of ice cream!

Farmer John's NN cows (2N50,0002 \leq N \leq 50,000) have each listed their five favorite flavors of ice cream. To make this list concise, each possible flavor is represented by a positive integer ID at most 10610^6. Two cows are compatible if their lists contain at least one common flavor of ice cream.

Please determine the number of pairs of cows that are NOT compatible

입력

The first line of input contains NN. Each of the following NN lines contain 5 integers (all different) representing the favorite ice cream flavors of one cow.

출력

Please output the number of pairs of cows that are not compatible.

예제 입력 1

4
1 2 3 4 5
1 2 3 10 8
10 9 8 7 6
50 60 70 80 90

예제 출력 1

4
코드 제출

코드를 제출하려면 로그인이 필요합니다.

로그인
내 제출
제출 내역이 없습니다.
맞은 사람
아직 맞은 사람이 없습니다.
난이도 투표
Unrated0명 투표
로그인 후 AC 받으면 투표할 수 있습니다.
전체 제출
제출 내역이 없습니다.