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){
				dp[i][j]=max(vec[i-1][1]+dp[i-1][j-vec[i-1][0]],dp[i][j-1]);
				dp[i][j]=max(dp[i][j],dp[i-1][j]);
			}else dp[i][j]=dp[i-1][j];
		}
	}
	
	cpout<<dp[n][k]<<endl;
	
	return 0;
}





























Compiler output:
a.cc: In function 'int main()':
a.cc:65:23: error: 'll' was not declared in this scope
   65 |         vector<vector<ll>> dp(n+1,vector<ll>(k+1,0));
      |                       ^~
a.cc:65:23: error: template argument 1 is invalid
a.cc:65:23: error: template argument 2 is invalid
a.cc:65:25: error: template argument 1 is invalid
   65 |         vector<vector<ll>> dp(n+1,vector<ll>(k+1,0));
      |                         ^~
a.cc:65:25: error: template argument 2 is invalid
a.cc:65:44: error: template argument 2 is invalid
   65 |         vector<vector<ll>> dp(n+1,vector<ll>(k+1,0));
      |                                            ^
a.cc:65:52: error: expression list treated as compound expression in initializer [-fpermissive]
   65 |         vector<vector<ll>> dp(n+1,vector<ll>(k+1,0));
      |                                                    ^
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:35: error: invalid types 'int[int]' for array subscript
   73 |                                 dp[i][j]=max(dp[i][j],dp[i-1][j]);
      |                                   ^
a.cc:73:48: error: invalid types 'int[int]' for array subscript
   73 |                                 dp[i][j]=max(dp[i][j],dp[i-1][j]);
      |                                                ^
a.cc:73:57: error: invalid types 'int[int]' for array subscript
   73 |                                 dp[i][j]=max(dp[i][j],dp[i-1][j]);
      |                                                         ^
a.cc:74:33: error: invalid types 'int[int]' for array subscript
   74 |                         }else dp[i][j]=dp[i-1][j];
      |                                 ^
a.cc:74:42: error: invalid types 'int[int]' for array subscript
   74 |                         }else dp[i][j]=dp[i-1][j];
      |                                          ^
a.cc:78:9: error: 'cpout' was not declared in this scope
   78 |         cpout<<dp[n][k]<<endl;
      |         ^~~~~
a.cc:78:18: error: invalid types 'int[int]' for array subscript
   78 |         cpout<<dp[n][k]<<endl;
      |                  ^