Type: Default 2000ms 256MiB

Oddly Similar

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

[ABC348F] Oddly Similar

题目描述

给出 NN 个长度为 MM 的序列 A1...NA_{1...N}

求有多少对 (i,j)(i,j) 满足 i<ji<j,并且两个序列 AiA_iAjA_j 恰好有奇数个位置上的数相同,

输入格式

第一行两个整数 N,MN,M ,接下来 NN 行,每行 MM 个整数表示一个序列。

输出格式

一个整数表示答案。

输入输出样例 #1

输入 #1

3 3
1 2 3
1 3 4
2 3 4

输出 #1

1

输入输出样例 #2

输入 #2

6 5
8 27 27 10 24
27 8 2 4 5
15 27 26 17 24
27 27 27 27 27
27 7 22 11 27
19 27 27 27 27

输出 #2

5

说明/提示

数据范围

  • 1  N  20001\ \leq\ N\ \leq\ 2000
  • 1  M  20001\ \leq\ M\ \leq\ 2000
  • 1  Ai,j  9991\ \leq\ A_{i,j}\ \leq\ 999

样例解释 1

(i,j) = (1,2)(i,j)\ =\ (1,2) 满足条件。

20250311集训

Not Attended
Status
Done
Rule
IOI
Problem
7
Start at
2025-3-11 19:30
End at
2025-3-11 21:30
Duration
2 hour(s)
Host
Partic.
9