五月天青色头像情侣网名,国产亚洲av片在线观看18女人,黑人巨茎大战俄罗斯美女,扒下她的小内裤打屁股

歡迎光臨散文網(wǎng) 會員登陸 & 注冊

ATcoder B - Discord

2023-06-01 15:39 作者:您是打尖兒還是住店呢  | 我要投稿

Time Limit: 2 sec / Memory Limit: 1024 MB

Score :?200200?points

Problem Statement

?N?people numbered?1,2,…,?1,2,,N?were in??M?photos. In each of the photos, they stood in a single line. In the??i-th photo, the??j-th person from the left is person???,?ai,j.

Two people who did not stand next to each other in any of the photos may be in a bad mood.

How many pairs of people may be in a bad mood? Here, we do not distinguish a pair of person?x?and person?y, and a pair of person?y?and person?x.

Constraints

  • 2≤N≤50

  • 1M50

  • 1ai,jN

  • 1,…,ai,1,,ai,N?contain each of?1,,N?exactly once.

  • All values in the input are integers.

Input

The input is given from Standard Input in the following format:

NM1,1a1,11,a1,N??,1aM,1aM,N

Output

Print the answer.

Sample Input 1?Copy

Copy

4 2 1 2 3 4 4 3 1 2

Sample Output 1?Copy

Copy

2

The pair of person?11?and person?44, and the pair of person?22?and person?44, may be in a bad mood.

Sample Input 2?Copy

Copy

3 3 1 2 3 3 1 2 1 2 3

Sample Output 2?Copy

Copy

0

Sample Input 3?Copy

Copy

10 10?

4 10 7 2 8 3 9 1 6 5?

3 6 2 9 1 8 10 7 4 5?

9 3 4 5 7 10 1 8 2 6?

7 3 1 8 4 9 5 6 2 10?

5 2 1 4 10 7 9 8 3 6?

5 8 1 6 9 3 2 4 7 10

8 10 3 4 5 7 2 9 6 1?

3 10 2 7 8 5 1 4 9 6?

10 6 1 5 4 2 3 8 9 7?

4 5 9 1 8 2 7 6 3 10

Sample Output 3?Copy

Copy

6

主要就是把所有挨著一起的人,放到set中,然后去遍歷看有多少個是沒有在set中。

AC


ATcoder B - Discord的評論 (共 條)

分享到微博請遵守國家法律
伽师县| 三都| 同仁县| 平南县| 龙里县| 江城| 颍上县| 建瓯市| 宁蒗| 吴江市| 巩义市| 诏安县| 永吉县| 伊春市| 泰顺县| 方城县| 怀来县| 恩平市| 图片| 昌邑市| 墨江| 榆林市| 大埔县| 呼玛县| 奉节县| 南昌县| 仁怀市| 泗阳县| 安顺市| 扶风县| 镇原县| 施甸县| 肇庆市| 富裕县| 玉龙| 建德市| 庆城县| 绥中县| 华池县| 宝坻区| 恩施市|