Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
80673 sh25_zhuwy 摆花 C++ 通过 2 MS 340 KB 393 2026-01-04 15:26:52

Tests(10/10):


#include <bits/stdc++.h> using namespace std; const int N=110,mod=1000007; int n,m,a[N],dp[N][N]; int main(){ cin>>n>>m; for(int i=1;i<=n;++i){ cin>>a[i]; } dp[0][0]=1; for(int i=1;i<=n;++i){ for(int j=0;j<=m;++j){ for(int k=0;k<=min(j,a[i]);++k){ dp[i][j]=(dp[i][j]+dp[i-1][j-k])%mod; } } } cout<<dp[n][m]; return 0 ; }


测评信息: