Language: C++

#include <sstream>
#include <fstream>
#include <deque>
#include <queue>
#include <stack>
#include <set>
#include <list>
#include <map>
#include <unordered_map>
#include <functional>
#include <utility>
#include <bitset>
#include <cstdlib>
#include <ctime>
#include <cstdio>


#include <stdlib.h>
#include <iostream>
#include <chrono> //clock
#include <vector>
#include <string>
#include <iomanip>  //setprecision function
#include <cmath>	//math
#include <cstdio>
#include <vector>	//vector array
#include <algorithm>	//STL algorithm
#include <set> //STL library set
#include <sstream> // for stringstream


using namespace std;
using namespace std::chrono; 


int main() {
	stringstream ss;
	//ss<<"akhil";
	//cout<<ss.str()<<endl;
	cout<<setprecision(16);
	ios::sync_with_stdio(0);
	cin.tie(0);
	
	
	 // TESTCASE KO DEKH KA BHAUT SARA CONDITION GENERATE MAT KRO 
	 // PAPER PD CONFIRM HO JAO THORA JADA TIME HI KYU NA LGA
	 
	 // WHILE DOING THE QUESTION OF DYNAMIC PROGRAMMING GREEDY KA TRAH SOCHNA BAND KRO
	 // DP M DATA KA BHI USE KRNA PDTA HA BE BHULO MT 
	 // DP BHI WO LEETCODE WALE MATRIX KA QUESTION KI TARAH HA
	 // CONSTRAIN WILL BE THE DIMENSION OF DP
	 // DP MA STATE PTA KRO AUR PHIR FUNCTION GENERATE KRO
	 // OBJECT KO CHOOSE KIA YA NAE KIA AGAR KIA TO KYA HOGA AUR NAE KIA TO KYA HOGA


	int n,k;
	cin>>n>>k;
	int vec[n][2];
	for(int i=0;i<n;i++){
		cin>>vec[i][0];
		cin>>vec[i][1];
	}
	
	vector<vector<ll>> dp(n+1,vector<ll>(k+1,0));

	
	//int dp[n][k];
	for(int i=1;i<=n;i++){
		for(int j=1;j<=k;j++){
			if(j-vec[i-1][0]>-1){
				if(i==3 and j==3) deb(dp[i-1][j-vec[i-1][0]]+vec[i-1][1]);
				dp[i][j]=max(vec[i-1][1]+dp[i-1][j-vec[i-1][0]],dp[i][j-1]);
			}else dp[i][j]=dp[i-1][j];
		}
	}
	
	fcout<<dp[n][k]<<endl;
	
	return 0;
}





























Compiler output:
a.cc: In function 'int main()':
a.cc:64:23: error: 'll' was not declared in this scope
   64 |         vector<vector<ll>> dp(n+1,vector<ll>(k+1,0));
      |                       ^~
a.cc:64:23: error: template argument 1 is invalid
a.cc:64:23: error: template argument 2 is invalid
a.cc:64:25: error: template argument 1 is invalid
   64 |         vector<vector<ll>> dp(n+1,vector<ll>(k+1,0));
      |                         ^~
a.cc:64:25: error: template argument 2 is invalid
a.cc:64:44: error: template argument 2 is invalid
   64 |         vector<vector<ll>> dp(n+1,vector<ll>(k+1,0));
      |                                            ^
a.cc:64:52: error: expression list treated as compound expression in initializer [-fpermissive]
   64 |         vector<vector<ll>> dp(n+1,vector<ll>(k+1,0));
      |                                                    ^
a.cc:71:57: error: invalid types 'int[int]' for array subscript
   71 |                                 if(i==3 and j==3) deb(dp[i-1][j-vec[i-1][0]]+vec[i-1][1]);
      |                                                         ^
a.cc:71:51: error: 'deb' was not declared in this scope
   71 |                                 if(i==3 and j==3) deb(dp[i-1][j-vec[i-1][0]]+vec[i-1][1]);
      |                                                   ^~~
a.cc:72:35: error: invalid types 'int[int]' for array subscript
   72 |                                 dp[i][j]=max(vec[i-1][1]+dp[i-1][j-vec[i-1][0]],dp[i][j-1]);
      |                                   ^
a.cc:72:60: error: invalid types 'int[int]' for array subscript
   72 |                                 dp[i][j]=max(vec[i-1][1]+dp[i-1][j-vec[i-1][0]],dp[i][j-1]);
      |                                                            ^
a.cc:72:83: error: invalid types 'int[int]' for array subscript
   72 |                                 dp[i][j]=max(vec[i-1][1]+dp[i-1][j-vec[i-1][0]],dp[i][j-1]);
      |                                                                                   ^
a.cc:73:33: error: invalid types 'int[int]' for array subscript
   73 |                         }else dp[i][j]=dp[i-1][j];
      |                                 ^
a.cc:73:42: error: invalid types 'int[int]' for array subscript
   73 |                         }else dp[i][j]=dp[i-1][j];
      |                                          ^
a.cc:77:9: error: 'fcout' was not declared in this scope
   77 |         fcout<<dp[n][k]<<endl;
      |         ^~~~~
a.cc:77:18: error: invalid types 'int[int]' for array subscript
   77 |         fcout<<dp[n][k]<<endl;
      |                  ^