Language: C++

 bool PredictTheWinner(vector<int>& nums) {
      vector<vector<pair<int, int>>> dp(nums.size(), vector<pair<int, int>>(nums.size(), make_pair(0, 0)));
      for(int ri=dp.size()-1; ri>=0; ri--)
      {
        for (int ci=ri; ci < dp[0].size(); ci++)
        {
          if(ci == ri)
          {
            dp[ri][ci] = make_pair(nums[ci], 0);
          }
          else
          {
            if(ci-ri == 1)
            {
              dp[ri][ci] = make_pair(max(nums[ci], nums[ci-1]), min(nums[ci], nums[ci-1]));
            }
            else
            {
              int last_val = nums[ci];
              int first_val = nums[ri];
              pair<int, int> temp1, temp2;
              pair<int, int> prev_col = dp[ri][ci-1];
              pair<int, int> below_row = dp[ri+1][ci];
              int temp1_diff, temp2_diff;
              
              //last val picked first
              temp1.first = last_val + prev_col.second;
              temp1.second = prev_col.first;
              temp1_diff = temp1.first - temp1.second;
              //cout << last_val << temp1.first << temp1.second <<  endl;

              //first val picked first
              temp2.first = first_val + below_row.second;
              temp2.second = below_row.first;
              temp2_diff = temp2.first - temp2.second;
              //cout << first_val << temp2.first << temp2.second <<  endl;
              
              if(temp1_diff > temp2_diff)
              {
                dp[ri][ci].first = temp1.first;
                dp[ri][ci].second = temp1.second;
              //cout << ri << ci ;
              }
              else
              {
                dp[ri][ci].first = temp2.first;
                dp[ri][ci].second = temp2.second;
              }
            }
          }
        }
      }
      /*
      for(int ri=0;  ri<=dp.size()-1; ri++)
      {
        for(int ci=0;  ci<=dp.size()-1; ci++)
        {
          cout << dp[ri][ci].first << " " << dp[ri][ci].second << "   ";
        }
        cout << endl;
      }
*/
      if(dp[0][dp[0].size()-1].first >= dp[0][dp[0].size()-1].second)
      {
        return true;
      }
      return false;
    }
};

int main
{
	int num_inputs, temp;
    cin >> num_inputs;
    vector<int> nums;
    for(int i=0; i<num_inputs; i++)
    {
    	cin >> temp;
        nums.push_back(temp);
    }
    cout << bool PredictTheWinner(nums);
	return 0;
}


Compiler output:
a.cc:1:24: error: 'vector' was not declared in this scope
    1 |  bool PredictTheWinner(vector<int>& nums) {
      |                        ^~~~~~
a.cc:1:31: error: expected primary-expression before 'int'
    1 |  bool PredictTheWinner(vector<int>& nums) {
      |                               ^~~
a.cc:69:1: error: expected declaration before '}' token
   69 | };
      | ^
a.cc:71:5: error: cannot declare '::main' to be a global variable
   71 | int main
      |     ^~~~
a.cc:73:9: error: expected primary-expression before 'int'
   73 |         int num_inputs, temp;
      |         ^~~
a.cc:73:9: error: expected '}' before 'int'
a.cc:72:1: note: to match this '{'
   72 | {
      | ^
a.cc:74:5: error: 'cin' does not name a type
   74 |     cin >> num_inputs;
      |     ^~~
a.cc:75:5: error: 'vector' does not name a type
   75 |     vector<int> nums;
      |     ^~~~~~
a.cc:76:5: error: expected unqualified-id before 'for'
   76 |     for(int i=0; i<num_inputs; i++)
      |     ^~~
a.cc:76:18: error: 'i' does not name a type
   76 |     for(int i=0; i<num_inputs; i++)
      |                  ^
a.cc:76:32: error: 'i' does not name a type
   76 |     for(int i=0; i<num_inputs; i++)
      |                                ^
a.cc:81:5: error: 'cout' does not name a type
   81 |     cout << bool PredictTheWinner(nums);
      |     ^~~~
a.cc:82:9: error: expected unqualified-id before 'return'
   82 |         return 0;
      |         ^~~~~~
a.cc:83:1: error: expected declaration before '}' token
   83 | }
      | ^