Language: C++

#include<bits/stdc++.h>


#define ff first
#define ss second
#define pb push_back
#define pf push_front
#define ins insert
#define mp make_pair
#define len(s) s.length()
#define forp(i,a,b) for( i=a;i<=b;i++)
#define rep(i,n)    for( i=0;i<n;i++)
#define ren(i,n)    for( i=n-1;i>=0;i--)
#define forn(i,a,b) for( i=a;i>=b;i--)
#define on cout<<endl
#define o2(a,b) cout<<a<<" "<<b
#define os cout<<" "
#define all(v) v.begin(),v.end()
#define mem(n,m) memset(n,m,sizeof(n))
#define pii pair<int,int>
#define pll pair<long long,long long>
#define sii set<int>
#define sll set<long long>
#define vii vector<int> 
#define vll vector<long long>
#define mll map<long long, long long>
#define lob lower_bound
#define upb upper_bound
#define ret return 0
#define present(s,x) (s.find(x) != s.end()) 
#define cpresent(s,x) (find(all(s),x) != s.end()) 
#define ford(container, it) for(__typeof(container.begin()) it = container.begin(); it != container.end(); it++) 
#define fors(container, it, a, b) for(__typeof(container.begin()) it = a; it != b; it++) 

#define boost ios_base::sync_with_stdio(0)
#define MOD 1000000007
#define EPSILON 1e-9
#define PI 3.14159265358979323846
#define inf 999999999999999999
#define siz 100001
#define SIZ 1000001
#define SIZE 200001

typedef long long  ll;
typedef long double  ldo;
typedef double  db ;
using namespace std;
#define pqb             priority_queue<int>
#define pqs             priority_queue<int,vi,greater<int> >
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define w(x)            int x; cin>>x; while(x--)

void c_p_c()
{
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
}
int dp[1000000][start];
int ansnikal(unordered_map <int,pair<int,int>> &data,int start,int sum,int mw,int &n)
{
    if(mw<=0){
        return sum;
    }
    if(dp[sum][start!=-1){
        return dp[sum][start];
    }
    else{
        int c=INT_MIN;
        for(int i=start;i<n;i++){
            if (mw-data[i].first<0){
                c=max(c,ansnikal(data,i+1,sum,mw-data[i].first,n));
            }
            else{
                c=max(c,ansnikal(data,i+1,sum+data[i].second,mw-data[i].first,n));
            }
        }
        return dp[sum][start]=c;
    }
}
int main()
{
   ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
   //c_p_c();
   int wm,n,temp1,temp2;
   cin>>n>>wm;
   memset(dp,-1,sizeof(dp));
   unordered_map <int,pair<int,int>> data;
   for(int i=0;i<n;i++){
       cin>>temp1>>temp2;
       data[i]={temp1,temp2};
   }
   cout<<ansnikal(data,0,0,wm,n)<<endl;
   return 0;
}

Compiler output:
a.cc:61:17: error: 'start' was not declared in this scope
   61 | int dp[1000000][start];
      |                 ^~~~~
a.cc: In function 'int ansnikal(std::unordered_map<int, std::pair<int, int> >&, int, int, int, int&)':
a.cc:67:8: error: 'dp' was not declared in this scope; did you mean 'dup'?
   67 |     if(dp[sum][start!=-1){
      |        ^~
      |        dup
a.cc:67:25: error: expected ']' before ')' token
   67 |     if(dp[sum][start!=-1){
      |                         ^
      |                         ]
a.cc: In function 'int main()':
a.cc:89:11: error: 'dp' was not declared in this scope; did you mean 'dup'?
   89 |    memset(dp,-1,sizeof(dp));
      |           ^~
      |           dup