{"problem":{"name":"Two Choices","description":{"content":"$N$ students took a test with $M$ questions with two choices: $0$ and $1$. You are given $N$ strings of length $M$ each: $S_1, S_2, \\ldots, S_N$. The $k$\\-th character of $S_i$ is `0` or `1`, represen","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"arc115_a"},"statements":[{"statement_type":"Markdown","content":"$N$ students took a test with $M$ questions with two choices: $0$ and $1$. You are given $N$ strings of length $M$ each: $S_1, S_2, \\ldots, S_N$. The $k$\\-th character of $S_i$ is `0` or `1`, representing the response of the $i$\\-th student to the $k$\\-th question. Although we know the response of each student to each question, we do not yet know the correct answer ― $0$ or $1$ ― to each problem. Find the number of pairs $(i, j)$ satisfying $1 \\leq i < j \\leq N$ such that it is impossible for Student $i$ and Student $j$ to have the same number of correct answers.\n\n## Constraints\n\n*   $2 \\leq N \\leq 10^5$\n*   $1 \\leq M \\leq 20$\n*   $S_i$ is a string of length $M$ consisting of `0` and `1`.\n\n## Input\n\nInput is given from Standard Input in the following format:\n\n$N$ $M$\n$S_1$\n$S_2$\n$:$\n$S_N$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"arc115_a","tags":[],"sample_group":[["3 2\n00\n01\n10","2\n\nFor example, if the correct answers to the $1$\\-st and $2$\\-nd questions are both $0$, Student $2$ and Student $3$ have the same number of correct answers ― $1$. On the other hand, Student $1$ and Student $2$ never have the same number of correct answers, nor do Student $1$ and Student $3$."],["7 5\n10101\n00001\n00110\n11110\n00100\n11111\n10000","10"]],"created_at":"2026-03-03 11:01:14"}}