Language: C++

#pragma GCC optimize("Ofast")
#include<cstdio>
#include<cstdlib>
#include<algorithm>
#include<iostream>
#include<queue>
#include<vector>
#include <bitset>
#include <cmath>
#include <limits>
#include <iostream>
#include <map>
#include<tuple>
using namespace std;
#define INF 1LL<<62
#define MAX 100000
#define MOD 1000000007
#define int ll;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<pair<int,int>,int> p;
#define bit(n,k) ((n>>k)&1) /*nのk bit目*/
#define rad_to_deg(rad) (((rad)/2/M_PI)*360)
struct edge{ll to,cost,val;};
template<class T,class U>bool chmin(T&a,const U&b){if(a<=b)return false;a=b;return true;}
template<class T,class U>bool chmax(T&a,const U&b){if(a>=b)return false;a=b;return true;}
//__builtin_popcount(S);
//C.erase(unique(C.begin(),C.end()),C.end());

ll dp[110][110000],sum[110][110000];
int a[110000];

signed main(){
    int N,K;
    cin>>N>>K;
    for(int i=1;i<=N;i++) cin>>a[i];

    for(int i=0;i<110;i++){
        dp[i][0]=1;
        sum[i][0]=1;
    } 

    for(int i=0;i<110000;i++) sum[0][i]=1;

    for(int i=1;i<=N;i++){
        int x=a[i];
        for(int j=1;j<=K;j++){
            if(j-x-1<0) dp[i][j]=sum[i-1][j];
            else dp[i][j]=sum[i-1][j]-sum[i-1][j-x-1];
            dp[i][j]%=MOD;
            sum[i][j]=sum[i][j-1]+dp[i][j];
            sum[i][j]%=MOD;
        }
    }
    cout<<dp[N][K]<<endl;
}

Compiler output:
a.cc:18:13: error: wrong number of template arguments (1, should be 2)
   18 | #define int ll;
      |             ^~
a.cc:20:14: note: in expansion of macro 'int'
   20 | typedef pair<int,int> P;
      |              ^~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
                 from /usr/include/c++/14/algorithm:60,
                 from a.cc:4:
/usr/include/c++/14/bits/stl_pair.h:89:12: note: provided for 'template<class _T1, class _T2> struct std::pair'
   89 |     struct pair;
      |            ^~~~
a.cc:20:1: warning: 'typedef' was ignored in this declaration
   20 | typedef pair<int,int> P;
      | ^~~~~~~
a.cc:20:17: error: expected unqualified-id before ',' token
   20 | typedef pair<int,int> P;
      |                 ^
a.cc:18:15: error: expected constructor, destructor, or type conversion before ';' token
   18 | #define int ll;
      |               ^
a.cc:20:18: note: in expansion of macro 'int'
   20 | typedef pair<int,int> P;
      |                  ^~~
a.cc:20:21: error: expected unqualified-id before '>' token
   20 | typedef pair<int,int> P;
      |                     ^
a.cc:18:13: error: wrong number of template arguments (1, should be 2)
   18 | #define int ll;
      |             ^~
a.cc:21:19: note: in expansion of macro 'int'
   21 | typedef pair<pair<int,int>,int> p;
      |                   ^~~
/usr/include/c++/14/bits/stl_pair.h:89:12: note: provided for 'template<class _T1, class _T2> struct std::pair'
   89 |     struct pair;
      |            ^~~~
a.cc:21:14: error: wrong number of template arguments (1, should be 2)
   21 | typedef pair<pair<int,int>,int> p;
      |              ^
/usr/include/c++/14/bits/stl_pair.h:89:12: note: provided for 'template<class _T1, class _T2> struct std::pair'
   89 |     struct pair;
      |            ^~~~
a.cc:21:1: warning: 'typedef' was ignored in this declaration
   21 | typedef pair<pair<int,int>,int> p;
      | ^~~~~~~
a.cc:21:22: error: expected unqualified-id before ',' token
   21 | typedef pair<pair<int,int>,int> p;
      |                      ^
a.cc:18:15: error: expected constructor, destructor, or type conversion before ';' token
   18 | #define int ll;
      |               ^
a.cc:21:23: note: in expansion of macro 'int'
   21 | typedef pair<pair<int,int>,int> p;
      |                       ^~~
a.cc:21:26: error: expected unqualified-id before '>' token
   21 | typedef pair<pair<int,int>,int> p;
      |                          ^
a.cc:21:31: error: expected unqualified-id before '>' token
   21 | typedef pair<pair<int,int>,int> p;
      |                               ^
a.cc:18:13: error: declaration does not declare anything [-fpermissive]
   18 | #define int ll;
      |             ^~
a.cc:31:1: note: in expansion of macro 'int'
   31 | int a[110000];
      | ^~~
a.cc:31:5: error: 'a' does not name a type
   31 | int a[110000];
      |     ^
a.cc: In function 'int main()':
a.cc:18:13: error: declaration does not declare anything [-fpermissive]
   18 | #define int ll;
      |             ^~
a.cc:34:5: note: in expansion of macro 'int'
   34 |     int N,K;
      |     ^~~
a.cc:34:9: error: 'N' was not declared in this scope
   34 |     int N,K;
      |         ^
a.cc:34:11: error: 'K' was not declared in this scope
   34 |     int N,K;
      |           ^
a.cc:18:13: error: declaration does not declare anything [-fpermissive]
   18 | #define int ll;
      |             ^~
a.cc:36:9: note: in expansion of macro 'int'
   36 |     for(int i=1;i<=N;i++) cin>>a[i];
      |         ^~~
a.cc:36:13: error: 'i' was not declared in this scope
   36 |     for(int i=1;i<=N;i++) cin>>a[i];
      |             ^
a.cc:36:21: error: expected ')' before ';' token
   36 |     for(int i=1;i<=N;i++) cin>>a[i];
      |        ~            ^
      |                     )
a.cc:36:22: error: 'i' was not declared in this scope
   36 |     for(int i=1;i<=N;i++) cin>>a[i];
      |                      ^
a.cc:18:13: error: declaration does not declare anything [-fpermissive]
   18 | #define int ll;
      |             ^~
a.cc:38:9: note: in expansion of macro 'int'
   38 |     for(int i=0;i<110;i++){
      |         ^~~
a.cc:38:22: error: expected ')' before ';' token
   38 |     for(int i=0;i<110;i++){
      |        ~             ^
      |                      )
a.cc:18:13: error: declaration does not declare anything [-fpermissive]
   18 | #define int ll;
      |             ^~
a.cc:43:9: note: in expansion of macro 'int'
   43 |     for(int i=0;i<110000;i++) sum[0][i]=1;
      |         ^~~
a.cc:43:25: error: expected ')' before ';' token
   43 |     for(int i=0;i<110000;i++) sum[0][i]=1;
      |        ~                ^
      |                         )
a.cc:18:13: error: declaration does not declare anything [-fpermissive]
   18 | #define int ll;
      |             ^~
a.cc:45:9: note: in expansion of macro 'int'
   45 |     for(int i=1;i<=N;i++){
      |         ^~~
a.cc:45:21: error: expected ')' before ';' token
   45 |     for(int i=1;i<=N;i++){
      |        ~            ^
      |                     )