Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
76534 sh25_shenpy 摆花 C++ 通过 2 MS 348 KB 397 2025-12-19 15:21:57

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 ; }


测评信息: