{"problem":{"name":"Hamming-Distant Arrays","description":{"content":"You are given an integer $N$. For length-$N^2$ integer sequences $a$ and $b$ consisting of integers between $1$ and $N$ (inclusive), we define their distance $d(a,b)$ as follows: *   $d(a,b)=$ \"the n","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"agc076_a"},"statements":[{"statement_type":"Markdown","content":"You are given an integer $N$. For length-$N^2$ integer sequences $a$ and $b$ consisting of integers between $1$ and $N$ (inclusive), we define their distance $d(a,b)$ as follows:\n\n*   $d(a,b)=$ \"the number of indices $i$ ($1 \\leq i \\leq N^2$) such that $a_i \\neq b_i$.\"\n\nNow, you will create $N$ length-$N^2$ integer sequences consisting of integers between $1$ and $N$, and denote them as $x_1,x_2,\\cdots,x_N$ (their order also matters). Find the number, modulo $998244353$, of instances of $(x_1,x_2,\\cdots,x_N)$ satisfying the following condition.\n\n*   For any length-$N^2$ integer sequence $y$ consisting of integers between $1$ and $N$, there exists some $1 \\leq i \\leq N$ such that $d(x_i,y) \\geq N^2-N$.\n\n## Constraints\n\n*   $1 \\leq N \\leq 50$\n*   All input values are integers.\n\n## Input\n\nThe input is given from Standard Input in the following format:\n\n$N$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"agc076_a","tags":[],"sample_group":[["2","80\n\nFor example, $(x_1,x_2)=((1,1,2,2),(1,2,1,2))$ does not satisfy the condition, because if $y=(1,1,1,2)$, then $d(x_1,y)=1,d(x_2,y)=1$.\nOn the other hand, $(x_1,x_2)=((1,1,1,1),(2,2,2,2))$ satisfies the condition.\nThere are $80$ instances of $(x_1,x_2)$ that satisfy the condition."],["3","597965565"],["10","241191911"]],"created_at":"2026-03-03 11:01:14"}}