第 76 场 AtCoder Grand Contest
A
汉明距离较大的数组
Hamming-Distant Arrays
AtCoder
⌀ 1986
原题
←B →

汉明距离较大的数组AI (CI翻译)

Problem Statement

题目描述

AI (CI翻译)

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^2$、由 $1$ 到 $N$(含)之间的整数构成的序列 $a$ 和 $b$,定义它们的距离 $d(a,b)$ 如下:AI (CI翻译)

  • $d(a,b)=$ "the number of indices $i$ ($1 \leq i \leq N^2$) such that $a_i \neq b_i$."
  • $d(a,b)=$“满足 $a_i \neq b_i$ 的下标 $i$($1 \leq i \leq N^2$)的数量”。
AI (CI翻译)

Now, 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^2$、由 $1$ 到 $N$ 之间的整数构成的序列,并将它们记为 $x_1,x_2,\cdots,x_N$(序列的顺序也有影响)。求满足以下条件的 $(x_1,x_2,\cdots,x_N)$ 的方案数,答案对 $998244353$ 取模。AI (CI翻译)

  • 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^2$、由 $1$ 到 $N$ 之间的整数构成的序列 $y$,都存在某个 $1 \leq i \leq N$,使得 $d(x_i,y) \geq N^2-N$。
AI (CI翻译)

Constraints

约束条件

AI (CI翻译)
  • $1 \leq N \leq 50$
  • All input values are integers.
  • $1 \leq N \leq 50$
  • 输入的所有数值均为整数。
AI (CI翻译)

Input

输入格式

AI (CI翻译)

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

输入通过标准输入给出,格式如下:AI (CI翻译)

N

N
AI (CI翻译)

Output

输出格式

AI (CI翻译)

Output the answer.

输出答案。AI (CI翻译)

样例

Input #1
2
Output #1
80
For 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$. On the other hand, $(x_1,x_2)=((1,1,1,1),(2,2,2,2))$ satisfies the condition. There are $80$ instances of $(x_1,x_2)$ that satisfy the condition.
Input #2
3
Output #2
597965565
Input #3
10
Output #3
241191911
题目信息
题号
agc076_a
时间限制
2 s
内存限制
1024 MB

题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(gpt-6.1-sol),如有出入请以原文为准。