Language: C++

#include <bits/stdc++.h>
#define pb push_back
#define int long long int
#define f(i,a,b) for (int i= a; i <b; ++i)
using namespace std;

signed main()
{
	ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    long long int n;
    cin>>n;
    long long int h[n],b[n];
    for(long long int i=0;i<n;i++)
        cin>>h[i];
    for(long long int i=0;i<n;i++)
        cin>>b[i];
    long long int dp[n];
    dp[0]=b[0];
    map<long long int,long long int> m;
    m[h[0]]=dp[0];
    long long int ans=b[0];
    for(long long int i=1;i<n;i++)
    {
        dp[i]=b[i];
        auto it=m.upper_bound(h[i]);
        if(it!=m.begin())
        {
            it--;
            dp[i]+=it->second;
        }
        m[h[i]]=dp[i];
        ans=max(ans,dp[i]);
        it=m.upper_bound(h[i]);
        while(it!=m.end()&&it->second<=dp[i])
        {
            auto temp=it;
            m.erase(it);
            it=temp;
            it++;
        }
    }
    cout<<ans;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:3:13: error: 'long long long' is too long for GCC
    3 | #define int long long int
      |             ^~~~
a.cc:12:15: note: in expansion of macro 'int'
   12 |     long long int n;
      |               ^~~
a.cc:3:18: error: 'long long long' is too long for GCC
    3 | #define int long long int
      |                  ^~~~
a.cc:12:15: note: in expansion of macro 'int'
   12 |     long long int n;
      |               ^~~
a.cc:3:13: error: 'long long long' is too long for GCC
    3 | #define int long long int
      |             ^~~~
a.cc:14:15: note: in expansion of macro 'int'
   14 |     long long int h[n],b[n];
      |               ^~~
a.cc:3:18: error: 'long long long' is too long for GCC
    3 | #define int long long int
      |                  ^~~~
a.cc:14:15: note: in expansion of macro 'int'
   14 |     long long int h[n],b[n];
      |               ^~~
a.cc:3:13: error: 'long long long' is too long for GCC
    3 | #define int long long int
      |             ^~~~
a.cc:15:19: note: in expansion of macro 'int'
   15 |     for(long long int i=0;i<n;i++)
      |                   ^~~
a.cc:3:18: error: 'long long long' is too long for GCC
    3 | #define int long long int
      |                  ^~~~
a.cc:15:19: note: in expansion of macro 'int'
   15 |     for(long long int i=0;i<n;i++)
      |                   ^~~
a.cc:3:13: error: 'long long long' is too long for GCC
    3 | #define int long long int
      |             ^~~~
a.cc:17:19: note: in expansion of macro 'int'
   17 |     for(long long int i=0;i<n;i++)
      |                   ^~~
a.cc:3:18: error: 'long long long' is too long for GCC
    3 | #define int long long int
      |                  ^~~~
a.cc:17:19: note: in expansion of macro 'int'
   17 |     for(long long int i=0;i<n;i++)
      |                   ^~~
a.cc:3:13: error: 'long long long' is too long for GCC
    3 | #define int long long int
      |             ^~~~
a.cc:19:15: note: in expansion of macro 'int'
   19 |     long long int dp[n];
      |               ^~~
a.cc:3:18: error: 'long long long' is too long for GCC
    3 | #define int long long int
      |                  ^~~~
a.cc:19:15: note: in expansion of macro 'int'
   19 |     long long int dp[n];
      |               ^~~
a.cc:3:13: error: 'long long long' is too long for GCC
    3 | #define int long long int
      |             ^~~~
a.cc:21:19: note: in expansion of macro 'int'
   21 |     map<long long int,long long int> m;
      |                   ^~~
a.cc:3:18: error: 'long long long' is too long for GCC
    3 | #define int long long int
      |                  ^~~~
a.cc:21:19: note: in expansion of macro 'int'
   21 |     map<long long int,long long int> m;
      |                   ^~~
a.cc:3:13: error: 'long long long' is too long for GCC
    3 | #define int long long int
      |             ^~~~
a.cc:21:33: note: in expansion of macro 'int'
   21 |     map<long long int,long long int> m;
      |                                 ^~~
a.cc:3:18: error: 'long long long' is too long for GCC
    3 | #define int long long int
      |                  ^~~~
a.cc:21:33: note: in expansion of macro 'int'
   21 |     map<long long int,long long int> m;
      |                                 ^~~
a.cc:3:13: error: 'long long long' is too long for GCC
    3 | #define int long long int
      |             ^~~~
a.cc:23:15: note: in expansion of macro 'int'
   23 |     long long int ans=b[0];
      |               ^~~
a.cc:3:18: error: 'long long long' is too long for GCC
    3 | #define int long long int
      |                  ^~~~
a.cc:23:15: note: in expansion of macro 'int'
   23 |     long long int ans=b[0];
      |               ^~~
a.cc:3:13: error: 'long long long' is too long for GCC
    3 | #define int long long int
      |             ^~~~
a.cc:24:19: note: in expansion of macro 'int'
   24 |     for(long long int i=1;i<n;i++)
      |                   ^~~
a.cc:3:18: error: 'long long long' is too long for GCC
    3 | #define int long long int
      |                  ^~~~
a.cc:24:19: note: in expansion of macro 'int'
   24 |     for(long long int i=1;i<n;i++)
      |                   ^~~