CF1916H1.Matrix Rank (Easy Version)
省选/NOI-
通过率:0%
时间限制:2.00s
内存限制:256MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
This is the easy version of the problem. The only differences between the two versions of this problem are the constraints on k. You can make hacks only if all versions of the problem are solved.
You are given integers n, p and k. p is guaranteed to be a prime number.
For each r from 0 to k, find the number of n×n matrices A of the field† of integers modulo p such that the rank‡ of A is exactly r. Since these values are big, you are only required to output them modulo 998244353.
† https://en.wikipedia.org/wiki/Field_(mathematics)
‡ https://en.wikipedia.org/wiki/Rank_(linear_algebra)
这是该问题的简单版本。两个版本的唯一区别在于对 k 的约束条件。只有当该问题的所有版本均被解决后,才允许进行 hack。
给定整数 n、p 和 k。其中 p 保证为质数。
对于每个从 0 到 k 的 r,求满足以下条件的 n×n 矩阵 A(其元素属于模 p 的整数域†)的个数:矩阵 A 的秩‡ 恰好为 r。由于结果可能很大,你只需输出这些数值对 998244353 取模的结果。
输入格式
The first line of input contains three integers n, p and k (1≤n≤1018, 2≤p<998244353, 0≤k≤5000).
It is guaranteed that p is a prime number.
输入的第一行包含三个整数 n、p 和 k(1≤n≤1018,2≤p<998244353,0≤k≤5000)。
保证 p 是一个质数。
输出格式
Output k+1 integers, the answers for each r from 0 to k.
输出 k+1 个整数,分别对应 r 从 0 到 k 的每个答案。
输入输出样例
输入#1
3 2 3
输出#1
1 49 294 168
输入#2
1 51549919 2
输出#2
1 51549918 0
输入解题思路,AI测评打分。不知道怎么写?