Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
80447 sh25_wangsj 摆花 C++ 通过 1 MS 340 KB 393 2026-01-04 15:17:27

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


测评信息: