Language: C++

#include<bits/stdc++.h>
#define r(i,n) for(int i=0;i<n;i++)
#define s second
#define f first
#define mk make_pair
using namespace std;
main(){
  int a,b,c,a1,b1,c1,x,y,z;
  cin>>a>>b>>c>>x>>y>>z;
  long int dp[2][a+3][b+3][c+3][100000000];
  memset(dp,0,sizeof(dp));
  vector<pair<int,pair<int,int> > >v[2];
  while(1)v[0].push_back(mk(0,mk(0,0)));
  if(a)dp[0][1][0][0]=x,v[0].push_back(mk(1,mk(0,0)));
  if(b)dp[0][0][1][0]=y,v[0].push_back(mk(0,mk(1,0)));
  if(c)dp[0][0][0][1]=z,v[0].push_back(mk(0,mk(0,1)));
  for(int i=1;i<a+b+c;i++){
    cin>>x>>y>>z;
    set<pair<int,pair<int,int> > >se;//cout<<v[(i+1)%2].size()<<endl;
    for(int j=0;j<v[(i+1)%2].size();j++){
      //pair<int,pair<int,int> >p=v[(i+1)%2][j];
      //a1=p.f,b1=p.s.f,c1=p.s.s;//cout<<a1<<b1<<c1<<endl;
     // if(a1<a)dp[i%2][a1+1][b1][c1]=max(dp[i%2][a1+1][b1][c1],dp[(i+1)%2][a1][b1][c1]+x);
      //if(b1<b)dp[i%2][a1][b1+1][c1]=max(dp[i%2][a1][b1+1][c1],dp[(i+1)%2][a1][b1][c1]+y);
      //if(c1<c)dp[i%2][a1][b1][c1+1]=max(dp[i%2][a1][b1][c1+1],dp[(i+1)%2][a1][b1][c1]+z);
     // p=mk(a1+1,mk(b1,c1));//if(a1<a)v[i%2].push_back(p);
      //if(!se.count(p)&&a1<a)v[i%2].push_back(p),se.insert(p);
      //p=mk(a1,mk(b1+1,c1));//if(b1<b)v[i%2].push_back(p);
      //if(!se.count(p)&&b1<b)v[i%2].push_back(p),se.insert(p);
      //p=mk(a1,mk(b1,c1+1));//if(c1<c)v[i%2].push_back(p);
      //if(!se.count(p)&&c1<c)v[i%2].push_back(p),se.insert(p);
    }
    v[(i+1)%2].clear();
  }
  long int ans=0;
  r(i,a)r(j,b)r(k,c)ans=max(ans,dp[(a+b+c-1)%2][a][b][c]);
  cout<<ans<<endl;
  return 0;
}

Compiler output:
a.cc:7:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    7 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:14:22: error: incompatible types in assignment of 'int' to 'long int [100000000]'
   14 |   if(a)dp[0][1][0][0]=x,v[0].push_back(mk(1,mk(0,0)));
      |        ~~~~~~~~~~~~~~^~
a.cc:15:22: error: incompatible types in assignment of 'int' to 'long int [100000000]'
   15 |   if(b)dp[0][0][1][0]=y,v[0].push_back(mk(0,mk(1,0)));
      |        ~~~~~~~~~~~~~~^~
a.cc:16:22: error: incompatible types in assignment of 'int' to 'long int [100000000]'
   16 |   if(c)dp[0][0][0][1]=z,v[0].push_back(mk(0,mk(0,1)));
      |        ~~~~~~~~~~~~~~^~
a.cc:36:28: error: no matching function for call to 'max(long int&, long int [100000000])'
   36 |   r(i,a)r(j,b)r(k,c)ans=max(ans,dp[(a+b+c-1)%2][a][b][c]);
      |                         ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:36:28: note:   deduced conflicting types for parameter 'const _Tp' ('long int' and 'long int [100000000]')
   36 |   r(i,a)r(j,b)r(k,c)ans=max(ans,dp[(a+b+c-1)%2][a][b][c]);
      |                         ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:36:28: note:   mismatched types 'std::initializer_list<_Tp>' and 'long int'
   36 |   r(i,a)r(j,b)r(k,c)ans=max(ans,dp[(a+b+c-1)%2][a][b][c]);
      |                         ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~