跳到正文

个人记录

挑战使用我和所有同学的码风写 P4463(假设在打模拟赛)

AVENGER_M约 1 分钟
原文
文章信息与版本

文章信息

收录
2025年12月12日
更新
2026年5月17日
篇幅
约 1 分钟

版本

  1. v1当前
C++
#include<bits/stdc++.h>
#define int long long
using namespace std;

int K, n, modp, f[3000][3000],a[3000],N=1000,jc[1005],ni[1005],njc[1005];

signed main(){
	freopen("calc.in","r",stdin);
	ofstream ofs("calc.out");
//cin.tie(0); cout.tie(0); ios::sync_with_stdio(0);
	scanf("%lld%lld%lld",&K,&n,&modp);
	ni[1]=1;for(int i=2;i<=N;i++)ni[i]=(modp-modp/i)*ni[modp%i]%modp;
	jc[0]=njc[0]=1;for(int i=1;i<=N;i++){jc[i]=jc[i-1]*i%modp;njc[i]=njc[i-1]*ni[i]%modp;}
	f[0][0]
}
原文