| 比赛 |
五一大礼包 |
评测结果 |
RRRRRRRRRR |
| 题目名称 |
组一辈子乐队 |
最终得分 |
0 |
| 用户昵称 |
汐汐很希希 |
运行时间 |
0.026 s |
| 代码语言 |
C++ |
内存使用 |
3.67 MiB |
| 提交时间 |
2026-05-04 10:57:49 |
显示代码纯文本
#include<bits/stdc++.h>
#define ll long long
using namespace std;
const int N=2e5+10;
const int mod=998244353;
ll n,k,a[N],t[510][510];
int main()
{
freopen("Mujica.in","r",stdin);
freopen("Mujica.out","w",stdout);
cin>>n>>k;
for(int i=1;i<=n;i++) cin>>a[i];
if(n>500){
cout<<"I can't give you answer"<<endl;
return 0;
}
for(int i=1;i<=n;i++) for(int j=1;j<=n;j++) t[i][j]=1;
for(int i=1;i<=k;i++)
{
ll sum=0;
for(int l=1;l<=n-1;l++)
{
for(int r=l+1;r<=n;r++)
{
t[l][r]=t[l][r]*(a[l]+a[r])%mod;
sum+=t[l][r];
sum%=mod;
//cout<<t[l][r]<<' '<<l<<' '<<r<<endl;
}
//cout<<endl;
}
cout<<sum<<endl;
}
return 0;
}