像这种论文结论题,现场基本不可能证明出来,猜都很难猜出来,只有看过论文知道。。
而对于我这种不是学有余力的人来说,记住结论就行了,这个论文就不看了。性价比太低。
https://arxiv.org/pdf/0706.2918.pdf 各位大牛有兴趣可以看看
https://www.cnblogs.com/LiuRunky/p/2020_Nowcoder_Multi_University_Contest_1.html
直接用了这位同学的总结。(没错我太懒了,论文都没打开过)
然后根据这篇论文发现题目给的就是Ferrers 图,然后直接写就行。。
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define re register
#define ls (o<<1)
#define rs (o<<1|1)
#define pb push_back
const double PI= acos(-1.0);
const int M = 1e5+7;
/*
int head[M],cnt=1;
void init(int n){cnt=1;for(int i=0;i<=n;i++)head[i]=0;}
struct EDGE{int to,nxt,w;}ee[M*2];
void add(int x,int y,int w){ee[++cnt].nxt=head[x],ee[cnt].w=w,ee[cnt].to=y,head[x]=cnt;}
*/
ll a[M],b[M];
int main()
{
int n,m,p;
while(~scanf("%d%d%d",&n,&m,&p))
{
for(int i=1;i<=m+1;i++)b[i]=0;
for(int i=1;i<=n;i++)scanf("%lld",&a[i]),b[a[i]]++;
for(int i=m;i>=1;i--)b[i]+=b[i+1];
sort(a+1,a+1+n);
sort(b+1,b+1+m);
ll ans=1;
for(int i=1;i<n;i++)ans=ans*a[i]%p;
for(int i=1;i<m;i++)ans=ans*b[i]%p;
printf("%lld\n",ans);
}
return 0;
}