Language: C++

#pragma GCC optimize(3, "Ofast", "inline")
#include <bits/stdc++.h>
#if __cplusplus >= 201103L
#include <chrono>
using namespace std::chrono;
#endif
using namespace std;
#define ll long long
#define ull unsigned long long
#define pii pair<int, int>
#define pb push_back
#define fi first
#define se second
#ifdef LOCAL
#define prl puts("\n------------------\n")
#define prln(x) (cout << #x << ' ' << x << endl)
#define pr(x) (cout << #x << ' ' << x << ' ' )
#define prv(x) (cout << x << ' ')
#else
#define prl 
#define prln(x) 
#define pr(x)
#define prv(x)
#endif
#define clr(x) memset((x), 0, sizeof((x)))
#define clr1(x) memset((x), -1, sizeof((x)))
#define endl "\n"
#define pi acos(-1)
#define rep(i, st, ed) for (int i = (st); i <= (ed); ++i)
#define rep0(i, st, ed) for (int i = (st); i < (ed); ++i)
#define per(i, st, ed) for (int i = (st); i >= ed; --i)
template<class T> void _sf(T &x) {cin >> x;}
void _sf(int &x) {scanf("%d", &x);}
void _sf(ll &x) {scanf("%lld", &x);}
void _sf(double &x) {scanf("%lf", &x);}
void _sf(char &x) {scanf(" %c", &x);}
void _sf(char *x) {scanf("%s", x);}
void sf() {}
template <class T, class...U> void sf(T & head, U&... tail) { _sf(head); sf(tail...);}
const int mod = 1e9 + 7;
const int INF = 0x3f3f3f3f;

int read() {
    int x = 0, f = 1;
    char ch = getchar();
    while (ch < '0' || ch > '9') {
        if (ch == '-') f = -1;
        ch = getchar();
    }
    while (ch >= '0' && ch <= '9') {
        x = x * 10 + ch - '0';
        ch = getchar();
    }
    return x * f;
}
cont int maxn =2e5 + 6;
ll f[maxn];
int n;

void insert(int i, ll v) {
    for (int x = i; x <= n; x += x & -x) {
        f[x] = max(f[x], v);
    }
}

ll query(int i) {
    ll ans = 0;
    for (int x = i; x; x -= x & -x) {
        ans = max(ans, f[x]);
    }
    return ans;
}

int main(){
    #ifdef LOCAL
        freopen("in.txt", "r", stdin);
        freopen("out.txt", "w", stdout);
        #if __cplusplus >= 201103L
        auto start = steady_clock::now();
        #endif
    #endif
    cin >> n;
    ll a[n], h[n], dp[n];
    for (int i = 0; i < n; ++i) cin >> h[i];
    for (int i = 0; i < n; ++i) cin >> a[i];
    ll ans = 0;
    for (int i = 0; i < n; ++i) {
        ll temp = query(h[i] - 1);
        dp[i] = temp + a[i];
        insert(h[i], dp[i]);
        ans = max(ans, dp[i]);
    }
    cout << ans << endl;
    #ifdef LOCAL
        #if __cplusplus >= 201103L
        auto end = steady_clock::now();
        duration<double> time_span = duration_cast<duration<double>>(end - start);;
        printf("Total time: %.6fs\n", time_span.count());
        #endif
    #endif
    return 0;
}

Compiler output:
a.cc:56:1: error: 'cont' does not name a type; did you mean 'const'?
   56 | cont int maxn =2e5 + 6;
      | ^~~~
      | const
a.cc:57:6: error: 'maxn' was not declared in this scope
   57 | ll f[maxn];
      |      ^~~~
a.cc: In function 'void insert(int, long long int)':
a.cc:62:9: error: 'f' was not declared in this scope
   62 |         f[x] = max(f[x], v);
      |         ^
a.cc: In function 'long long int query(int)':
a.cc:69:24: error: 'f' was not declared in this scope
   69 |         ans = max(ans, f[x]);
      |                        ^