Language: C++

#include <bits/stdc++.h>
#define mod 1000000007
using namespace std;
int n,k,a[109];
long long dp[109][100009],sdp[109][100009];
int main()
{
    cin>>n>>k;
    for(int i=1;i<=n;i++)cin>>a[i];
    //sort(a,a+n+1);
    for(int i=1;i<=n;i++)
    {
        for(int j=1;j<=a[i]&&j<=k#include <bits/stdc++.h>
#define mod 1000000007
using namespace std;
int n,k,a[109];
long long dp[109][100009],sdp[109][100009];
int main()
{
    cin>>n>>k;
    for(int i=1;i<=n;i++)cin>>a[i];
    //sort(a,a+n+1);
    
    for(int i=1;i<=n;i++)
    {
        for(int j=1;j<=a[i];j++)
        {
            dp[i][j]++;
            dp[i][j]=(dp[i][j]+sdp[i-1][j])%mod;
            sdp[i][j]=(dp[i][j]+sdp[i][j-1])%mod;
        }
        for(int j=a[i]+1;j<=k;j++)
        {
            dp[i][j]=(sdp[i-1][j]-sdp[i-1][j-a[i]-1])%mod;
            sdp[i][j]=(sdp[i][j-1]+dp[i][j])%mod;
        }
        dp[i][0]=1;
    }
    /*for(int i=0;i<=n;i++)
    {
        for(int j=0;j<=k;j++)cout<<dp[i][j]<<" ";
        cout<<"\n";
    }*/
    cout<<dp[n][k]%mod;
}
;j++)
        {
            dp[i][j]++;
            dp[i][j]=(dp[i][j]+sdp[i-1][j])%mod;
            sdp[i][j]=(dp[i][j]+sdp[i][j-1])%mod;
        }
        for(int j=a[i]+1;j<=k;j++)
        {
            dp[i][j]=(sdp[i-1][j]-sdp[i-1][j-a[i]-1])%mod;
            sdp[i][j]=(sdp[i][j-1]+dp[i][j])%mod;
        }
        dp[i][0]=1;
    }
    /*for(int i=0;i<=n;i++)
    {
        for(int j=0;j<=k;j++)cout<<dp[i][j]<<" ";
        cout<<"\n";
    }*/
    cout<<dp[n][k]%mod;
}


Compiler output:
a.cc:13:34: error: stray '#' in program
   13 |         for(int j=1;j<=a[i]&&j<=k#include <bits/stdc++.h>
      |                                  ^
a.cc: In function 'int main()':
a.cc:13:34: error: expected ';' before 'include'
   13 |         for(int j=1;j<=a[i]&&j<=k#include <bits/stdc++.h>
      |                                  ^~~~~~~~
      |                                  ;
a.cc:13:35: error: 'include' was not declared in this scope
   13 |         for(int j=1;j<=a[i]&&j<=k#include <bits/stdc++.h>
      |                                   ^~~~~~~
a.cc:13:44: error: 'bits' was not declared in this scope
   13 |         for(int j=1;j<=a[i]&&j<=k#include <bits/stdc++.h>
      |                                            ^~~~
a.cc:13:49: error: 'stdc' was not declared in this scope; did you mean 'std'?
   13 |         for(int j=1;j<=a[i]&&j<=k#include <bits/stdc++.h>
      |                                                 ^~~~
      |                                                 std
a.cc:15:1: error: expected primary-expression before 'using'
   15 | using namespace std;
      | ^~~~~
a.cc:13:58: error: expected ')' before 'using'
   13 |         for(int j=1;j<=a[i]&&j<=k#include <bits/stdc++.h>
      |            ~                                             ^
      |                                                          )
   14 | #define mod 1000000007
   15 | using namespace std;
      | ~~~~~                                                     
a.cc:18:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   18 | int main()
      |         ^~
a.cc:18:9: note: remove parentheses to default-initialize a variable
   18 | int main()
      |         ^~
      |         --
a.cc:18:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:19:1: error: a function-definition is not allowed here before '{' token
   19 | {
      | ^
a.cc:46:2: error: 'j' was not declared in this scope
   46 | ;j++)
      |  ^