{"problem":{"name":"Oddly Similar","description":{"content":"There are $N$ sequences of length $M$, denoted as $A_1, A_2, \\ldots, A_N$. The $i$\\-th sequence is represented by $M$ integers $A_{i,1}, A_{i,2}, \\ldots, A_{i,M}$. Two sequences $X$ and $Y$ of length ","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"abc348_f"},"statements":[{"statement_type":"Markdown","content":"There are $N$ sequences of length $M$, denoted as $A_1, A_2, \\ldots, A_N$. The $i$\\-th sequence is represented by $M$ integers $A_{i,1}, A_{i,2}, \\ldots, A_{i,M}$.\nTwo sequences $X$ and $Y$ of length $M$ are said to be similar if and only if the number of indices $i (1 \\leq i \\leq M)$ such that $X_i = Y_i$ is odd.\nFind the number of pairs of integers $(i,j)$ satisfying $1 \\leq i < j \\leq N$ such that $A_i$ and $A_j$ are similar.\n\n## Constraints\n\n*   $1 \\leq N \\leq 2000$\n*   $1 \\leq M \\leq 2000$\n*   $1 \\leq A_{i,j} \\leq 999$\n*   All input values are integers.\n\n## Input\n\nThe input is given from Standard Input in the following format:\n\n$N$ $M$\n$A_{1,1}$ $A_{1,2}$ $\\ldots$ $A_{1,M}$\n$A_{2,1}$ $A_{2,2}$ $\\ldots$ $A_{2,M}$\n$\\vdots$\n$A_{N,1}$ $A_{N,2}$ $\\ldots$ $A_{N,M}$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"abc348_f","tags":[],"sample_group":[["3 3\n1 2 3\n1 3 4\n2 3 4","1\n\nThe pair $(i,j) = (1,2)$ satisfies the condition because there is only one index $k$ such that $A_{1,k} = A_{2,k}$, which is $k=1$.\nThe pairs $(i,j) = (1,3), (2,3)$ do not satisfy the condition, making $(1,2)$ the only pair that does."],["6 5\n8 27 27 10 24\n27 8 2 4 5\n15 27 26 17 24\n27 27 27 27 27\n27 7 22 11 27\n19 27 27 27 27","5"]],"created_at":"2026-03-03 11:01:14"}}