criyle/codenet-compile-errors huggingface dataset:
Language: C++

#include <bits/stdc++.h>
 
using namespace std;

#define endl '\n'
#define precise(n,k) fixed << setprecision(k) << n
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()

#define uint  unsigned int
#define ll    long long
#define ull   unsigned long long
#define ld    long double

const int MOD = int(1e9+7);
const int oo  = int(1e9 + 20);
const ll lloo  = (ll)(1e18 + 10);


template <typename T, class F = function<T(const T&, const T&)>>
class SegmentTree {
    int NEUTRAL;
    int n;
    vector<int> tree;
    F func;
public:
    
    SegmentTree(vector<int> values, int neutral, const F& f) : func(f) {
        NEUTRAL = neutral;
        
        n = values.size();
        tree.resize(n*2);
        // Build
        for (int i=0; i < n; i++){
            tree[n+i] = values[i];
        }
        for (int i = n - 1; i > 0; --i) {
            tree[i] = func(tree[i*2], tree[i*2+1]);
        }
    }
    
    void update(int index, int value) {
        tree[index+n] = value;
        index = index + n;
        for (int i = index; i > 1; i >>= 1){
            tree[i/2] = func(tree[i], tree[i^1]);
        }
    }
    
    int query(int l, int r) {
        int ans = NEUTRAL;
        for (l += n, r += n; l < r; l >>= 1, r >>= 1) {
            if (l&1) {
                ans = func(ans, tree[l++]);
            }
            if (r&1) {
                ans = func(ans, tree[--r]);
            }
        }
        return ans;
    }
};

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int n;
    cin >> n;
    n++;
    vector<int> val(n);
    for(int i = 1; i < n; ++i) {
        cin >> val[i];
    }
    
    SegmentTree<int> st(values, -oo, [&](int x, int y) -> int {return max(x, y);});
    
    vector<bool> visited(n, false);
    int colors = 0;
    int last;
    for(int i = 1; i < n; ++i) {
        if(!visited[i]) {
            colors++;
            last = val[i];
            visited[i] = true;
            st.update(i, -oo);
            
            if(st.query(i+1, n) <= last) continue;
            
            for(int j = i + 1; j < n; ++j) {
                if(!visited[j] && last < val[j]) {
                    last = val[j];
                    visited[j] = true;
                    st.update(j, -oo);
                    if(st.query(j+1, n) <= last) break;
                }
            }
        }
    }
    cout << colors << endl;

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:76:25: error: 'values' was not declared in this scope
   76 |     SegmentTree<int> st(values, -oo, [&](int x, int y) -> int {return max(x, y);});
      |                         ^~~~~~
Language: C++

#include <vector>
#include <iostream>

using namespace std;
struct _ { ios_base::Init i; _() { ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL); } } _;

int main() {

	int n; cin >> n;
	vector<int> a(n); for (int i = 0; i <= n - 1; i++) cin >> a[i];

	vector<int> st;

	int mx = 0, pre = INT_MAX;

	for (int i = 0; i <= n - 1; i++) {
		pre = min(pre, a[i]);
		if (a[i] == pre) mx++;
	}

	cout << mx;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:27: error: 'INT_MAX' was not declared in this scope
   14 |         int mx = 0, pre = INT_MAX;
      |                           ^~~~~~~
a.cc:3:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    2 | #include <iostream>
  +++ |+#include <climits>
    3 |
Language: C++

#include<bits/stdc++.h>
using namespace std;
int N=1e5+5,n,ans,q[N],f[N],dp[N],a[N];
int main(){
	cin>>n;
	for(int i=1;i<=n;i++)cin>>a[i];
	memset(q,0x3f,sizeof(q));
	for(int i=1;i<=n;i++){
		f[i]=upper_bound(q+1,q+n,-a[i])-q;
		q[f[i]]=-a[i];
		ans=max(ans,f[i]);
	}
	cout<<ans<<endl;
 }


Compiler output:
a.cc:3:21: error: size of array 'q' is not an integral constant-expression
    3 | int N=1e5+5,n,ans,q[N],f[N],dp[N],a[N];
      |                     ^
a.cc:3:26: error: size of array 'f' is not an integral constant-expression
    3 | int N=1e5+5,n,ans,q[N],f[N],dp[N],a[N];
      |                          ^
a.cc:3:32: error: size of array 'dp' is not an integral constant-expression
    3 | int N=1e5+5,n,ans,q[N],f[N],dp[N],a[N];
      |                                ^
a.cc:3:37: error: size of array 'a' is not an integral constant-expression
    3 | int N=1e5+5,n,ans,q[N],f[N],dp[N],a[N];
      |                                     ^
Language: C++

#include <bits/stdc++.h>

using namespace std;
using ll = long long;
using vec = vector<ll>;
using mat = vector<vec>;

#define INF (1LL << 60)
#define MOD 1000000007
#define PI 3.14159265358979323846

#define REP(i,m,n) for(ll (i)=(m),(i_len)=(n);(i)<(i_len);++(i))
#define FORR(i,v) for(auto (i):v)
#define ALL(x) (x).begin(), (x).end()
#define PR(x) cout << (x) << endl
#define PS(x) cout << (x) << " "
#define SZ(x) ((ll)(x).size())
#define MAX(a,b) (((a)>(b))?(a):(b))
#define MIN(a,b) (((a)<(b))?(a):(b))
#define ASC(x) sort(ALL((x)))
#define DESC(x) sort(ALL((x)),greater<ll>())
#define REV(x) reverse(ALL((x)))
#define eb emplace_back

int main()
{
    ll N;
    cin >> N;

    vector<pair<ll,ll>> P;
    ll a, min, max;
    cin >> a;
    max = a; min = a;
    REP(i,1,N) {
        cin >> a;
        if(max < a) max = a;
        else {
            P.eb(min, max);
            min = a; max = a;
        }
    }
    P.eb(min, max);

    ll M = SZ(P);
    vec S(M);
    vector<pair<ll,ll>> T(M);
    REP(i,0,M) {
        S[i] = P[i].second;
        T[i] = make_pair(P[i].first, i);
    }
    ASC(T);

    vector<bool> head(M+1, true), seen(M+1, false);
    ll k = 0, l, m;
    while(k < M) {
        l = k;
        while(l < M) {
            pair<ll,ll> p = {S[l], INF};
            m = upper_bound(ALL(T), p) - T.begin();
            while(seen[m]) ++m;
            if(m => M) break;
            seen[m] = true;
            l = T[m].second;
            head[l] = false;
        }
        ++k;
        while(!head[k]) ++k;
    }

    ll cnt = 0;
    FORR(f,head) cnt += f;
    PR(cnt-1);

    return 0;
}

/*



*/

Compiler output:
a.cc: In function 'int main()':
a.cc:61:19: error: expected primary-expression before '>' token
   61 |             if(m => M) break;
      |                   ^
Language: C++

#include <cstdio>
#include <set>

using namespace std;

#define int long long
#define dotimes(i, n) for (int i = 0, i##max__ = (n); i < i##max__; i++)

int rint() {
  int x;
  scanf("%lld", &x);
  return x;
}

void wint(int x) {
  printf("%lld\n", x);
}

template<typename T>
int size(T const& container) {
  return static_cast<int>(container.size());
}

template <typename T>
bool maxs(T& a, T const& b) {
  return a < b ? a = b, true : false;
}

template <typename T>
bool mins(T& a, T const& b) {
  return a > b ? a = b, true : false;
}

signed main() {
  const int N = rint();
  multiset<int> s;
  dotimes(i, N) {
    int A = rint();
    auto it = s.lower_bound(A);
    if (it != s.begin())
      s.erase(--it);
    s.insert(A);
  }
  wint(size(s));
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:44:12: error: call of overloaded 'size(std::multiset<long long int>&)' is ambiguous
   44 |   wint(size(s));
      |        ~~~~^~~
a.cc:20:5: note: candidate: 'long long int size(const T&) [with T = std::multiset<long long int>]'
   20 | int size(T const& container) {
      |     ^~~~
In file included from /usr/include/c++/14/set:65,
                 from a.cc:2:
/usr/include/c++/14/bits/range_access.h:262:5: note: candidate: 'constexpr decltype (__cont.size()) std::size(const _Container&) [with _Container = multiset<long long int>; decltype (__cont.size()) = long unsigned int]'
  262 |     size(const _Container& __cont) noexcept(noexcept(__cont.size()))
      |     ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
const int N=1e5+5;
int n,ans;
int q[N],f[N];
int dp[N],a[N];
int main()
{
	cin>>n;
	for(int i=1;i<=n;i++)
	{
		cin>>a[i]
	}
	memset(q,0x3f,sizeof(q));
	for(int i=1;i<=n;i++)
	{
		f[i]=upper_bound(q+1,q+n,-a[i])-q;
		q[f[i]]=-a[i];
		ans=max(ans,f[i]);
	}
	cout<<ans<<endl;
 } 

Compiler output:
a.cc: In function 'int main()':
a.cc:12:26: error: expected ';' before '}' token
   12 |                 cin>>a[i]
      |                          ^
      |                          ;
   13 |         }
      |         ~
Language: C++

#include<bits/stdc++.h>
using namespace std;
const int N=1e5+5;
int n,ans;
int q[N],f[N];
int dp[N],a[N];
int main()
{
	cin>>n;
	for(int i=0;i<n;i++)
	{
		cin>>a[i]
	}
	memset(q,0x3f,sizeof(q));
	for(int i=1;i<=n;i++)
	{
		f[i]=upper_bound(q+1,q+n,-a[i])-q;
		q[f[i]]=-a[i];
		ans=max(ans,f[i]);
	}
	cout<<ans<<endl;
 } 

Compiler output:
a.cc: In function 'int main()':
a.cc:12:26: error: expected ';' before '}' token
   12 |                 cin>>a[i]
      |                          ^
      |                          ;
   13 |         }
      |         ~
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i < (n);++i)
using namespace std;
template <class _t> inline bool chmax (_t& a,_t b){if(a<b){a=b;return true;}return false;} template <class _t> inline bool chmin (_t& a,_t b){if(a>b){a=b;return true;}return false;}

const int INF = 2147483647;
const long long inf = 1ll << 60;
const long long mod = 1000000007;

int dx[4] = {1,0,-1,0};int dy[4] = {0,-1,0,1};
int main() {
    int n;cin >> n;
    vector<int> a(n),b(n);
    for(int i=0;i<n;i++) cin >> a[i];
    for(int i=0;i<n;i++) b[i] = a[n-i-1];
    vector<int> dp(n+1,INF);
    for(int i=0;i<n;i++){
	vector<int>::iterator itr2 = upper_bound(dp.begin(),dp.end(),b[i]);
	else *itr2 = b[i];
    }

    int ans = lower_bound(dp.begin(),dp.end(),INF)-dp.begin();
    cout << ans << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:9: error: 'else' without a previous 'if'
   19 |         else *itr2 = b[i];
      |         ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ll long long
#define ld long double
int gcd(int x, int y) { return (x % y)? gcd(y, x % y): y; }    //最大公約数
ll lcm(ll x, ll y) { return x / gcd(x, y) * y; }     //最小公倍数
using Graph = vector<vector<ll>>;
ll inf=300000000000000000;
const double PI = 3.14159265358979323846;
#define INF 1e+9
#define MAX_N 200000

int dp[MAX_N];
int n;
vector<int> a;

int lis() {
    fill(dp, dp+n, INF);
    for (int i=0; i<n; ++i) {
        *upper_bound(dp, dp+n, a[i]) = a[i];
    }
    return lower_bound(dp, dp+n, INF) - dp;
}


int main(){
  cin >> n;
  a.resize(n);
  rep(i,n)cin >> a[n-i-1];
  int u=a[i];
  int o=0;
  rep(i,n-1)if(u!=a[i+1])o++;
  if(o==0){
    cout << n << endl;
    return 0;
  }
  
  cout << lis() << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:11: error: 'i' was not declared in this scope
   31 |   int u=a[i];
      |           ^
Language: C++

c#include<bits/stdc++.h>
using namespace std;

int N;
int A[100000];

signed main() {
  cin >> N;
  for(int i=0; i<N; i++) cin >> A[i];

  int color = 1;
  multiset<int> s;
  s.insert(A[0]);

  for(int i=1; i<N; i++) {
    int a = A[i];
    auto lb = s.lower_bound(a);
    if(lb == s.end()) {
      auto rb = s.rbegin();
      s.insert(a);
      s.erase(prev(s.end()));
    }
    else if(lb == s.begin()) {
      s.insert(a);
      color++;
    }
    else {
      auto p = prev(lb);
      s.insert(a);
      s.erase(lb);
    }
  }
  cout << color << endl;
}


Compiler output:
a.cc:1:2: error: stray '#' in program
    1 | c#include<bits/stdc++.h>
      |  ^
a.cc:1:1: error: 'c' does not name a type
    1 | c#include<bits/stdc++.h>
      | ^
a.cc: In function 'int main()':
a.cc:8:3: error: 'cin' was not declared in this scope
    8 |   cin >> N;
      |   ^~~
a.cc:12:3: error: 'multiset' was not declared in this scope
   12 |   multiset<int> s;
      |   ^~~~~~~~
a.cc:12:12: error: expected primary-expression before 'int'
   12 |   multiset<int> s;
      |            ^~~
a.cc:13:3: error: 's' was not declared in this scope
   13 |   s.insert(A[0]);
      |   ^
a.cc:21:15: error: 'prev' was not declared in this scope
   21 |       s.erase(prev(s.end()));
      |               ^~~~
a.cc:28:16: error: 'prev' was not declared in this scope
   28 |       auto p = prev(lb);
      |                ^~~~
a.cc:33:3: error: 'cout' was not declared in this scope
   33 |   cout << color << endl;
      |   ^~~~
a.cc:33:20: error: 'endl' was not declared in this scope
   33 |   cout << color << endl;
      |                    ^~~~
Language: C++

#include<bits//stdc++>h>
using namespace std;
int dp[100005], a[100005], n;
int LIS_nlgn() {
  int len = 1;dp[0] = a[0];
  for (int i = 1; i < n; ++i) {
    if (a[i] >= dp[len - 1]) dp[len++] = a[i];
    else *lower_bound(dp, dp + len, a[i]) = a[i];
  }
  return len;
}
int main() {
  cin >> n;
  for (int i = n - 1; i >= 0; i--) cin >> a[i];
  cout << LIS_nlgn() << endl;
}

Compiler output:
a.cc:1:24: warning: extra tokens at end of #include directive
    1 | #include<bits//stdc++>h>
      |                        ^
a.cc:1:9: fatal error: bits//stdc++>: No such file or directory
    1 | #include<bits//stdc++>h>
      |         ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef pair<int,int> pii;

long long MOD = 1000000000 + 7;

int main(){
  cout << setprecision(10);
  int N;
  cin >> N;

  deque<int> q;
  for(int i = 0; i < N; i++){
    int tmp;
    cin >> tmp;
    auto itr = upper_bound(q.begin(), q.end(), tmp);
    int index = distance(itr - q.begin());
    if(index == 0){
      q.push_front(tmp);
    } else { 
      q[index-1] = tmp;
    }
  }
  cout << q.size() << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:25: error: no matching function for call to 'distance(std::_Deque_iterator<int, int&, int*>::difference_type)'
   19 |     int index = distance(itr - q.begin());
      |                 ~~~~~~~~^~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:66,
                 from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:148:5: note: candidate: 'template<class _InputIterator> constexpr typename std::iterator_traits< <template-parameter-1-1> >::difference_type std::distance(_InputIterator, _InputIterator)'
  148 |     distance(_InputIterator __first, _InputIterator __last)
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:148:5: note:   candidate expects 2 arguments, 1 provided
In file included from /usr/include/c++/14/filesystem:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:200:
/usr/include/c++/14/bits/fs_path.h:1431:1: note: candidate: 'std::ptrdiff_t std::distance(filesystem::__cxx11::path::iterator, filesystem::__cxx11::path::iterator)'
 1431 | distance(filesystem::path::iterator __first, filesystem::path::iterator __last)
      | ^~~~~~~~
/usr/include/c++/14/bits/fs_path.h:1431:1: note:   candidate expects 2 arguments, 1 provided
Language: C++

import sys


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7
    n = int(readline())
    a = [int(readline()) for _ in range(n)]
    cnt = 0
    while len(a):
        cnt += 1
        t_a = []
        mt = -1
        for i in range(len(a)):
            if mt >= a[i]:
                t_a.append(a[i])
            else:
                mt = a[i]
        a = t_a
    print(cnt)


if __name__ == '__main__':
    solve()


Compiler output:
a.cc:23:16: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes
   23 | if __name__ == '__main__':
      |                ^~~~~~~~~~
a.cc:1:1: error: 'import' does not name a type
    1 | import sys
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0; i<(n); i++)
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
int main(){
    ll n; cin>>n;
    vector<ll> c={-1};
    rep(i,n){
        ll a; cin>>a;
        ll s=c.size();
        if(c[0]<a){
            c[0]=a;
        }else{
            ll left=0, right=s;
            while(right-len>1){
                ll mid=(left+right)/2;
                if(c[mid]>=a) left=mid;
                else right=mid;
            }
          	if(right==s) c.push_back(a);
            else c[right]=a;
        }
        //rep(j, col.size()) cout<<col[j]<<' ';
    }
    cout<<c.size()<<endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:25: error: 'len' was not declared in this scope
   17 |             while(right-len>1){
      |                         ^~~
Language: C++

int main() {
    int N;
    cin >> N;
    vector<int> A(N);
    for (int i = 0; i < N; i++) {
        cin >> A[i];
        A[i] *= -1;
    }
    vector<int> B;
    for (int i = 0; i < N; i++) {
        auto itr = upper_bound(B.begin(), B.end(), A[i]);
        if (itr == B.end()) {
            B.push_back(A[i]);
        } else {
            *itr = A[i];
        }
    }
    cout << B.size() << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:5: error: 'cin' was not declared in this scope
    3 |     cin >> N;
      |     ^~~
a.cc:4:5: error: 'vector' was not declared in this scope
    4 |     vector<int> A(N);
      |     ^~~~~~
a.cc:4:12: error: expected primary-expression before 'int'
    4 |     vector<int> A(N);
      |            ^~~
a.cc:6:16: error: 'A' was not declared in this scope
    6 |         cin >> A[i];
      |                ^
a.cc:9:12: error: expected primary-expression before 'int'
    9 |     vector<int> B;
      |            ^~~
a.cc:11:32: error: 'B' was not declared in this scope
   11 |         auto itr = upper_bound(B.begin(), B.end(), A[i]);
      |                                ^
a.cc:11:52: error: 'A' was not declared in this scope
   11 |         auto itr = upper_bound(B.begin(), B.end(), A[i]);
      |                                                    ^
a.cc:11:20: error: 'upper_bound' was not declared in this scope
   11 |         auto itr = upper_bound(B.begin(), B.end(), A[i]);
      |                    ^~~~~~~~~~~
a.cc:18:5: error: 'cout' was not declared in this scope
   18 |     cout << B.size() << endl;
      |     ^~~~
a.cc:18:13: error: 'B' was not declared in this scope
   18 |     cout << B.size() << endl;
      |             ^
a.cc:18:25: error: 'endl' was not declared in this scope
   18 |     cout << B.size() << endl;
      |                         ^~~~
Language: C++

#include <iostream>
#include <vector>

using namespace std;

int main() {
    int n = 0, m = 0, z = 0;
    vector<int> x;
    cin >> n;
    for (int i = 0; i < n; i++) {
        cin >> z;
        if (i != 0) {
            int maxv = *max_element(x.begin(), x.end());
            if (z <= maxv)
                x.push_back(z);
        } else {
            x.push_back(z);
        }
    }
    cout << x.size();


    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:25: error: 'max_element' was not declared in this scope
   13 |             int maxv = *max_element(x.begin(), x.end());
      |                         ^~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(v) v.begin(),v.end()
#define _GLIBCXX_DEBUG
int main() {
    int n;
    cin>>n;
    int a[n];
    rep(i,n){
        cin>>a[i];
    }
    multiset<int> ms;
    ms.insert(a[0]);
    rep(i,n-1){
        auto index=ms.lower_bound(a[i+1]);
        if (index!=ms.begin()){
            ms.erase(--index);
        }
        ma.insert(a[i+1]);

    }
    cout<<ms.size()<<endl;

    

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:9: error: 'ma' was not declared in this scope; did you mean 'ms'?
   22 |         ma.insert(a[i+1]);
      |         ^~
      |         ms
Language: C++

#include<bits/stdc++.h>
#include<unordered_set>
#include<unordered_map>
#include <iostream>
#include <string>
#include <cmath>
using namespace std;
#define ll long long
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define FORR(i,a,b)for(ll i=(a);i<=(b);i++)
#define repR(i,n) for(ll i=n;i>=0;i--)
#define all(v)(v).begin(),(v).end()
#define rall(v)(v).rbegin(),(v).rend()
#define F first
#define S second
#define pb push_back
#define pu push
#define COUT(x) cout<<(x)<<endl
#define PQ priority_queue<ll>
#define PQR priority_queue<ll,vector<ll>,greater<ll>>
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define mp make_pair
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define sz(x) (int)(x).size()
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll MOD = 1000000007LL;
const ll INF = 1LL << 60;
using vll = vector<ll>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vvll = vector<vll>;
using vstr = vector<string>;
using pll = pair<ll, ll>;
using vc = vector<char>;
using vvc = vector<vc>;
ll dx[4]={0,1,0,-1};
ll dy[4]={1,0,-1,0};
int main(){
  ll n;
  cin>>n;
  vector<int> k(0);
  vector<int> a(n);
  rep(i,n){
    cin>>a[i];
  }
  k.pb(a[n-1]);
  for(int i=n-2;i>=0;i--){
    if(a[i]>=k[sz(k)-1]){
      k.pb(a[i]);
    }
    else if(a[i]<k[0]){
      k[0]=a[i];
    }
    else{
      auto Iter1 = upper_bound(all(k)), a[i]);
      ll cu=Iter1 - k.begin();
      k[cu]=a[i];
    }
  }
  COUT(sz(k));
}


Compiler output:
a.cc: In function 'int main()':
a.cc:59:31: error: no matching function for call to 'upper_bound(std::vector<int>::iterator, std::vector<int>::iterator)'
   59 |       auto Iter1 = upper_bound(all(k)), a[i]);
      |                    ~~~~~~~~~~~^~~~~~~~
In file included from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algo.h:2019:5: note: candidate: 'template<class _FIter, class _Tp> _FIter std::upper_bound(_FIter, _FIter, const _Tp&)'
 2019 |     upper_bound(_ForwardIterator __first, _ForwardIterator __last,
      |     ^~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:2019:5: note:   candidate expects 3 arguments, 2 provided
/usr/include/c++/14/bits/stl_algo.h:2050:5: note: candidate: 'template<class _FIter, class _Tp, class _Compare> _FIter std::upper_bound(_FIter, _FIter, const _Tp&, _Compare)'
 2050 |     upper_bound(_ForwardIterator __first, _ForwardIterator __last,
      |     ^~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:2050:5: note:   candidate expects 4 arguments, 2 provided
Language: C++

#include<bits/stdc++.h>
#include<unordered_set>
#include<unordered_map>
#include <iostream>
#include <string>
#include <cmath>
using namespace std;
#define ll long long
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define FORR(i,a,b)for(ll i=(a);i<=(b);i++)
#define repR(i,n) for(ll i=n;i>=0;i--)
#define all(v)(v).begin(),(v).end()
#define rall(v)(v).rbegin(),(v).rend()
#define F first
#define S second
#define pb push_back
#define pu push
#define COUT(x) cout<<(x)<<endl
#define PQ priority_queue<ll>
#define PQR priority_queue<ll,vector<ll>,greater<ll>>
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define mp make_pair
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define sz(x) (int)(x).size()
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll MOD = 1000000007LL;
const ll INF = 1LL << 60;
using vll = vector<ll>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vvll = vector<vll>;
using vstr = vector<string>;
using pll = pair<ll, ll>;
using vc = vector<char>;
using vvc = vector<vc>;
ll dx[4]={0,1,0,-1};
ll dy[4]={1,0,-1,0};
int main(){
  ll n;
  cin>>n;
  vll k(0);
  vll a(n);
  rep(i,n){
    cin>>a[i];
  }
  k.pb(a[n-1]);
  for(int i=n-2;i>=0;i--){
    if(a[i]>=k[sz(k)-1]){
      k.pb(a[i]);
    }
    else if(a[i]<k[0]){
      k[0]=a[i];
    }
    else{
      auto Iter1 = upper_bound(all(k)), a[i]);
      ll cu=Iter1 - k.begin();
      k[cu]=a[i];
    }
  }
  COUT(sz(k));
}

Compiler output:
a.cc: In function 'int main()':
a.cc:59:31: error: no matching function for call to 'upper_bound(std::vector<long long int>::iterator, std::vector<long long int>::iterator)'
   59 |       auto Iter1 = upper_bound(all(k)), a[i]);
      |                    ~~~~~~~~~~~^~~~~~~~
In file included from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algo.h:2019:5: note: candidate: 'template<class _FIter, class _Tp> _FIter std::upper_bound(_FIter, _FIter, const _Tp&)'
 2019 |     upper_bound(_ForwardIterator __first, _ForwardIterator __last,
      |     ^~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:2019:5: note:   candidate expects 3 arguments, 2 provided
/usr/include/c++/14/bits/stl_algo.h:2050:5: note: candidate: 'template<class _FIter, class _Tp, class _Compare> _FIter std::upper_bound(_FIter, _FIter, const _Tp&, _Compare)'
 2050 |     upper_bound(_ForwardIterator __first, _ForwardIterator __last,
      |     ^~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:2050:5: note:   candidate expects 4 arguments, 2 provided
Language: C++

#include<bits/stdc++.h>
#include <unordered_map>
#define int long long int
#define double long double
#define endl "\n"
#define PI 3.141592653589793238462643383279502884
#define sum_up(x)  (x*(x+1))/2
#define sp(x)   setprecision(x)
#define ceil(a,b)   (a+(b-1))/b

using namespace std;

void base()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
}
/*
bool prime[100001];
void sieve(int n)
{
    memset(prime, true, sizeof(prime));

    for (int p=2; p*p<=n; p++)
    {
        if (prime[p] == true)
        {
            for (int i=p*p; i<=n; i += p)
                prime[i] = false;
        }
    }
}
int power(int x, int y)
{
    int res = 1;
    while (y > 0)
    {
        if (y & 1)
            res = res * x;
        y = y >> 1;
        x = x * x;
    }
    return res;
}

double float_sq(double n)
{
    double x = n;
    double y = 1;
    double e = 0.000001;
    while (x - y > e)
    {
        x = (x + y) / 2;
        y = n / x;
    }
    return x;
}

int int_sq(int x)
{
    if (x == 0 || x == 1)
        return x;
    int start = 1, end = x, ans;
    while (start <= end)
    {
        int mid = (start + end) / 2;
        if (mid*mid == x)
            return mid;
        if (mid*mid < x)
        {
            start = mid + 1;
            ans = mid;
        }
        else
            end = mid-1;
    }
    return ans;
}*/

int32_t main()
{
    base();
    int n;
    cin>>n;
    vector<int>v(n);
    for(int i=0;i<n;i++)cin>>v[i];
    multiset<int>st;
    for(int i=0;i< n;i++) {
        auto itr = st.lower_bound(v[i]);
        if (st.size() == 0) st.insert(v[i]);
        if (itr == st.begin()) st.insert(v[i]);
        else{
        it--;
        st.erase(it);
        st.insert(v[i]);
        }
    }
    cout<<st.size();
    return 0;
}


Compiler output:
a.cc: In function 'int32_t main()':
a.cc:94:9: error: 'it' was not declared in this scope; did you mean 'itr'?
   94 |         it--;
      |         ^~
      |         itr
Language: C++

#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define all(v) v.begin(), v.end()
using in = int64_t;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
const double PI=3.14159265358979323846;
const in MOD = 1000000007;
const int INF=2000000000;
#define vec2(a,y,x) vector<vector<int>> a(y,vector<int>(x,0))
#define vec1(a,n) vector<int> a(n);rep(i,n)cin>>a[i]
using P=pair<int,int>;
vector<int> dx={0,1,-1,0};
vector<int> dy={1,0,0,-1};

int main(){
  ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
int n;
  cin>>n;
  vec1(a,n);
  int ans=0;
  while(a.size()){
    n=a.size();
    ans ++;
  	vector<int> dp(n,INF);//dp[i]:=i+1文字の部分列の最後の文字の最小値
  	rep(i,n) *lower_bound(all(dp),a[i])=a[i];
    int cnt=0;
    int i=0;
  	while(dp[cnt]!=INF){
      if(dp[cnt]==a[i]){a.erase(a.begin()+i); cnt ++;}
      else i ++;
    }
   
  cout<<ans<<endl;
 // cout<<lower_bound(all(dp),INF)-dp.begin()<<endl;
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:38:2: error: expected '}' at end of input
   38 | }
      |  ^
a.cc:17:11: note: to match this '{'
   17 | int main(){
      |           ^
Language: C++

#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define all(v) v.begin(), v.end()
using in = int64_t;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
const double PI=3.14159265358979323846;
const in MOD = 1000000007;
const int INF=2000000000;
#define vec2(a,y,x) vector<vector<int>> a(y,vector<int>(x,0))
#define vec1(a,n) vector<int> a(n);rep(i,n)cin>>a[i]
using P=pair<int,int>;
vector<int> dx={0,1,-1,0};
vector<int> dy={1,0,0,-1};

int main(){
  ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
int n;
  cin>>n;
  vec1(a,n);
  int ans=0;
  while(a.size()){
    ans ++;
  	vector<int> dp(n,INF);//dp[i]:=i+1文字の部分列の最後の文字の最小値
  	rep(i,n) *lower_bound(all(dp),a[i])=a[i];
    int cnt=0;
  	rep(i,n){
      if(dp[cnt]==INF) break;
      if(dp[cnt]==a[i]){ erase(a.begin()+i); cnt ++;}
    }
  }
  cout<<ans<<endl;
 // cout<<lower_bound(all(dp),INF)-dp.begin()<<endl;
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:30:26: error: 'erase' was not declared in this scope
   30 |       if(dp[cnt]==a[i]){ erase(a.begin()+i); cnt ++;}
      |                          ^~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;

typedef pair<int, int> P;
typedef long long ll;

#define rep(i, n) for(int i = 0; i < (n); i++)
#define repto(i, n) for(int i = 0; i <= (n); i++)
#define all(c) (c).begin(), (c).end()
#define uniq(c) c.erase(unique(all(c)), (c).end())
#define _1 first
#define _2 second
#define pb push_back
#define INF 1145141919
#define MOD 1000000007
#define DEBUG(x) cout << #x << ": " << x << endl;
template<typename T> T gcd(T a, T b) { if (b == 0) return a; return gcd(b, a % b); }

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);

  int N;
  cin >> N;
  vector <int> A(N);
  int a;
  multiset<int> s;
  int cnt = 1;
  int temp = INF;
  cin >> a;
  s.insert(a);
  for(int i = 1; i < N; i++) {
    cin >> a;
    // cout << *(s.begin()) << endl;
    if (a <= *(s.begin())) {
      s.insert(a);
      cnt++;
    }
    else {
      s.erase((--s.upper_bound(a)));
      s.insert(a);
    }
    // for(auto ite = s.begin(); ite != s.end(); ite++) {
    //   cout << *ite << ' ';
    }
    cout << endl;
  }
  cout << cnt << endl;
}


Compiler output:
a.cc:48:3: error: 'cout' does not name a type
   48 |   cout << cnt << endl;
      |   ^~~~
a.cc:49:1: error: expected declaration before '}' token
   49 | }
      | ^
Language: C++

#include <set> 
#include <bits/stdc+.h>
#include <iostream>

using namespace std;

int main(){
  int N;
  long long int a[100010];
  
  cin >> N;
  
  for(int i=0;i<N;i++){
    cin >> a[i];
  }
  
  multiset<long long int> mlt;
  
  for(int i=0;i<N;i++){
    
    auto k = mlt.lower_bound(a[i]);
    
    if(k != mlt.begin()) mlt.erase(k--);
    
    mlt.insert(a[i]);
    
  }
  
  cout << mlt.size() << endl;
}

Compiler output:
a.cc:2:10: fatal error: bits/stdc+.h: No such file or directory
    2 | #include <bits/stdc+.h>
      |          ^~~~~~~~~~~~~~
compilation terminated.
Language: C++

#pragma gcc optimize("Ofast")
#include<bits/stdc++.h>
using namespace std;
#define FOR(i,r,n) for(ll i=(ll)(r);i<(ll)(n);++i)
#define RFOR(i,r,n) for(ll i=(ll)(n-1);i>=r;--i)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define ALL(x) x.begin(),x.end()
#define RALL(x) x.rbegin(),x.rend()
#define SORT(c) sort(ALL((c)))
#define RSORT(c) sort(RALL((c)))
#define pb(n) push_back(n)
#define endl '\n'
#define IN(n) cin >> n
#define IN2(a,b) cin >> a >> b
#define IN3(a,b,c) cin >> a >> b >> c
#define VIN(V) for(int ii = 0; ii < (V).size(); ii++) {cin >> (V).at(ii);}
#define OUT(n) cout << n << endl
#define VOUT(V) REP(ii,(V).size()){cout << (V)[ii] << " ";} cout<<endl;
#define VOUT2(V) REP(jj,(V).size()){VOUT(V[jj])}
#define debug(x) cout << #x << " = " << (x) << endl
#define debugv(x) cout << #x << " = "; VOUT(x);
typedef long long int ll;
typedef vector<ll> vi;
typedef vector<vi > vvi;
typedef vector<pair<ll, ll> > vp;
typedef vector<string> vs;
typedef vector<char> vc;
typedef list<ll> lst;
typedef pair<ll, ll> P;
const long long INF = numeric_limits<ll>::max();
const long long MOD = 1000000007;
const long double PI = 3.1415926;
template <class T> T &chmin(T &a, const T &b) { return a = min(a, b); }
template <class T> T &chmax(T &a, const T &b) { return a = max(a, b); }
ll n, m, k, ans, sum, cnt = 0; string s; char c;

int main(){
  cin.tie(0);ios::sync_with_stdio(false);
  IN(n);
  vi a(n);
  VIN(a);

  vi ansv;
  ansv.pb(a[0]);
  FOR(i,1,n) {
    ll now = a[i];
    if (now <= ansv[0]) {
      ansv.pb(a[i]);
    } else {
      auto iter = upper_bound(ALL(ansv), now)
      *iter = a[i];
    }
  }

  OUT(ansv.size());
}


Compiler output:
a.cc: In function 'int main()':
a.cc:52:8: error: use of 'iter' before deduction of 'auto'
   52 |       *iter = a[i];
      |        ^~~~
Language: C++

#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<string>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
const ll mod=1e9+7;
ll n,k;
int main(){
  ll n;
  cin>>n;
  vector<ll> v;
  for(int i=0;i<n;i++){
    ll a;
    cin>>a;
    v.push_back(a);
  }
  ll mm=0,ans=0;
  for(int i=n-1;i>=0;i-—){
    if(v[i]>=mm){
      ans++;
      mm=v[i];
}}
cout<<ans<<endl;
}


Compiler output:
a.cc:22:24: error: extended character — is not valid in an identifier
   22 |   for(int i=n-1;i>=0;i-—){
      |                        ^
a.cc: In function 'int main()':
a.cc:22:24: error: '\U00002014' was not declared in this scope
   22 |   for(int i=n-1;i>=0;i-—){
      |                        ^
Language: C++

#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<string>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
const ll mod=1e9+7;
ll n,k;
int main(){
  ll n;
  cin>>n;
  vector<ll> v;
  for(int i=0;i<n;i++){
    ll a;
    cin>>a;
    v.push_back(a);
  }
  ll mm=0,ans=0;
  for(int i=n-1;i>=0;i—){
    if(v[i]>=mm){
      ans++;
      mm=v[i];
}}
cout<<ans<<endl;
}


Compiler output:
a.cc:22:22: error: extended character — is not valid in an identifier
   22 |   for(int i=n-1;i>=0;i—){
      |                      ^
a.cc: In function 'int main()':
a.cc:22:22: error: 'i\U00002014' was not declared in this scope
   22 |   for(int i=n-1;i>=0;i—){
      |                      ^~
Language: C++

#include <iostream>
#include<string>
#include<cmath>
#include<algorithm>
#include<cctype>
#include<queue>
#include<deque>
#include<regex>
#include<stack>
#include<stdio.h>
#include<vector>
#include<set>
#include<map>
#include<iomanip>

#define rep(i, n) for(int i=0;i<n;i++)

typedef int long long ll;
using namespace std;
typedef pair<int, int> P;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
const ll MOD = 1e9 + 7;
static const int MAX = 100;
static const int INF = (1 << 23);

template<class T>
T gcd(T a, T b) { return b ? gcd(b, a % b) : a; }

template<class T>
T lcm(T a, T b) { return a / gcd(a, b) * b; }


int main() {
    ll n;
    cin>>n;
    vector<ll> a(n);
    //priority_queue<pair<ll,int>> q;
    rep(i,n){
        cin>>a[i];

    }
    //sort(a.begin(),a.end());
    vector<ll> p;
    p.push_back(a[0]);


    for(int i=1;i<n;i++){
        sort(p.begin(),p.end());
        auto c = p.lower_bound(a[i]);
       // cout<< (c-p.begin())<<"c"<<endl;
        if(c==p.begin()){
            p.push_back(a[i]);
        }else{
            c--;
            p.erase(c);
            p.push_back(a[i]);
        }
//        rep(i,p.size())cout<<p[i];
//        cout<<endl;

    }



  cout<<p.size()<<endl;


    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:50:20: error: 'class std::vector<long long int>' has no member named 'lower_bound'
   50 |         auto c = p.lower_bound(a[i]);
      |                    ^~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

const int N = int(1e5 + 5);
const int mod = int(1e9 + 7);
const double eps = 1e-9;
const double pi = 3.1415926535897932384626433832795;

multiset<int> s;

void solve() {
  s.insert(-1);
  int n; scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    int x; scanf("%d", &x);
    auto i = s.lower_bound(x);
    if (i != s.begin()) {
      i--; s.erase(*i);
    }
    s.insert(x);
  }
  printf("%d\n", s.size());
}

int main() {
  //freopen(".in", "r", stdin);
  //freopen(".out", "w", stdout);
  int tests = 1;
  //scanf("%d", &tests);
  while (tests--) {
    solve();
  }
  return 0;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:19:10: error: redeclaration of 'auto i'
   19 |     auto i = s.lower_bound(x);
      |          ^
a.cc:17:12: note: 'int i' previously declared here
   17 |   for (int i = 0; i < n; i++) {
      |            ^
Language: Java

import java.util.ArrayList;
import java.util.Scanner;
class Main{


	static char[][] map;

	static long[][] c;
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);			//文字の入力
		int n = sc.nextInt();
		int[] a = new int[n];
		for(int i = 0;i < n;i++){
			a[i] = sc.nextInt();
		}

		ArrayList<Stack> list = new ArrayList<Stack>();
		int ans = 0;
		
		for(int i = 0;i < n;i++){
			if(list.size() == 0){
				Stack stack = new Stack();
				stack.push(a[i]);
				list.add(stack);
			}else{
				int vail = -1;
				int candidate = -1;
				int candidatenum = -1;
				
				for(int j = 0;j < list.size();j++){
					if(list.get(j).peak() < a[i] &&  candidatenum < list.get(j).peak() ){ 			//a[i] < a[j} でかつその中から最大の値をpeakをもつstackを見つける
 						candidate = j;
						candidatenum = list.get(j).peak();
						vail = 0;
					}
				}
				if(vail == 0){					//候補がいればそこにa[i]を追加
					list.get(candidate).push(a[i]);
				}else{							//候補がなければ新しくstackを追加
					Stack stack = new Stack();
					stack.push(a[i]);
					list.add(stack);
				}
			}
			
		}
			
		System.out.println(list.size());

	}



	static int gcd(int a,int b){				//最大公約数を返す
		if(b == 0){
			return a;
		}else{
			return gcd(b, a%b);
		}
	}
	static long gcd(long a,long b){
		if(b == 0){
			return a;
		}else{
			return gcd(b, a%b);
		}
	}



	static long lcm (long a, long b) {
		long g = gcd(a,b);
		return a/g*b;
	}




}



class Pair implements Comparable{
	int from;
	int end;
	@Override
	public int compareTo(Object other) {
		Pair otherpair = (Pair)other;

		return   end- otherpair.end;
	}








}






Compiler output:
Main.java:17: error: cannot find symbol
		ArrayList<Stack> list = new ArrayList<Stack>();
		          ^
  symbol:   class Stack
  location: class Main
Main.java:17: error: cannot find symbol
		ArrayList<Stack> list = new ArrayList<Stack>();
		                                      ^
  symbol:   class Stack
  location: class Main
Main.java:22: error: cannot find symbol
				Stack stack = new Stack();
				^
  symbol:   class Stack
  location: class Main
Main.java:22: error: cannot find symbol
				Stack stack = new Stack();
				                  ^
  symbol:   class Stack
  location: class Main
Main.java:40: error: cannot find symbol
					Stack stack = new Stack();
					^
  symbol:   class Stack
  location: class Main
Main.java:40: error: cannot find symbol
					Stack stack = new Stack();
					                  ^
  symbol:   class Stack
  location: class Main
6 errors
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;

int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  rep(i,n) cin >> a[i];
  deque<int> d;
  rep(i,n) {
    int p = lower_bound(d.begin(), d.end(), a[i]);
    if (p == 0) {
      d.push_front(a[i]);
    } else d[p-1] = a[i];
  }
  int ans = d.size();
  cout << ans << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:24: error: cannot convert 'std::_Deque_iterator<int, int&, int*>' to 'int' in initialization
   12 |     int p = lower_bound(d.begin(), d.end(), a[i]);
      |             ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
      |                        |
      |                        std::_Deque_iterator<int, int&, int*>
Language: C++

#define MX 100005
#define ll long long
#define INF 1000000005
using namespace std;

int main(){
    int n,a,col[MX],ans=0;
    cin>>n>>a;
    fill(col,col+n,0);
    col[0]=-a;
    rep(i,n-1){
        cin>>a;
        *upper_bound(col,col+n,-a)=-a;
    }
    ans=lower_bound(col,col+n,0)-col;
    cout<<ans<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:5: error: 'cin' was not declared in this scope
    8 |     cin>>n>>a;
      |     ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #define MX 100005
a.cc:9:5: error: 'fill' was not declared in this scope; did you mean 'll'?
    9 |     fill(col,col+n,0);
      |     ^~~~
      |     ll
a.cc:11:9: error: 'i' was not declared in this scope
   11 |     rep(i,n-1){
      |         ^
a.cc:11:5: error: 'rep' was not declared in this scope
   11 |     rep(i,n-1){
      |     ^~~
a.cc:15:9: error: 'lower_bound' was not declared in this scope
   15 |     ans=lower_bound(col,col+n,0)-col;
      |         ^~~~~~~~~~~
a.cc:16:5: error: 'cout' was not declared in this scope
   16 |     cout<<ans<<endl;
      |     ^~~~
a.cc:16:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:16:16: error: 'endl' was not declared in this scope
   16 |     cout<<ans<<endl;
      |                ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | #define MX 100005
Language: C++

#include<bits/stdc++.h>
using namespace std;

#define PI 3.1415926535897932


int main(){
    int mod=1000000007;
    int n;
    scanf("%d",&n);
    vector <int> a(n);
    for (int i=0;i<n;i++) {
        auto it=lower_bound(d.rbegin(),d.rend(),a[i]);
        if (it==d.rbegin()) {
            d.push_back(a[i]);
        } else {
            --it;
            *it=a[i];
        }
    }
    int ans=d.size();
    printf("%d\n",ans);
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:29: error: 'd' was not declared in this scope
   13 |         auto it=lower_bound(d.rbegin(),d.rend(),a[i]);
      |                             ^
a.cc:21:13: error: 'd' was not declared in this scope
   21 |     int ans=d.size();
      |             ^
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main()
{
  int n;
  cin>>n;
  int a[n],i,j,keep,ans=0;
  bool f[n];
  for(i=0;i<n;i++){
    cin>>a[i];
    f[i]=0;
  }
  keep=-1;
  for(i=0;i<n;i++){
    if(f[i]==0){
      keep=a[i];f[i]=1;
      for(j=i+1;j<n;j++){
        if(a[j]>keep&&f[j]==0){
          keep=a[j];
          f[j]=1;
        }
      }
      ans++;
      keep=-1;
    }
    flag=0;
    for(j=0;j<n;j++){
      if(f[j]==0){
        flag=1;
      }
    }
    if(flag==0){
      break;
    }
  }
  cout<<ans<<endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:27:5: error: 'flag' was not declared in this scope
   27 |     flag=0;
      |     ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
 int a[MAX_N];
 int n, k;

int main() {
    int n;
    vector<int> vec;
    vector<int> vec_sorted;
    cin >> n;
    
    for (int i = 0; i < n; i++) {
        cin >> vec[i];
    }
    vec_stored = vec;
    sort(vec_sorted.begin(), vec_sorted.end(), greater<int>());

    top1 = vec_sorted.at(0);
    top2 = vec_sorted.at(1);

    for(int i = 0; i < n; i++) {
        if (top1 == vec[i]) {
            cout << top2 << endl;
        } else {
            cout << top1 << endl;
        }
    }
    return 0;
}

Compiler output:
a.cc:4:8: error: 'MAX_N' was not declared in this scope
    4 |  int a[MAX_N];
      |        ^~~~~
a.cc: In function 'int main()':
a.cc:16:5: error: 'vec_stored' was not declared in this scope; did you mean 'vec_sorted'?
   16 |     vec_stored = vec;
      |     ^~~~~~~~~~
      |     vec_sorted
a.cc:19:5: error: 'top1' was not declared in this scope
   19 |     top1 = vec_sorted.at(0);
      |     ^~~~
a.cc:20:5: error: 'top2' was not declared in this scope
   20 |     top2 = vec_sorted.at(1);
      |     ^~~~
Language: Java

import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Map;
import java.util.NoSuchElementException;
import java.util.TreeMap;

public class Main {
    public static void main(String[] args) {
        FastScanner sc = new FastScanner();
        int N = sc.nextInt();
        PrintWriter out = new PrintWriter(System.out);
        TreeMap<Integer, Integer> map = new TreeMap<>();
        int color = 0;
        for (int i=0; i<N; i++) {
            Integer A = sc.nextInt();
            Map.Entry<Integer, Integer> entry = map.floorEntry(A-1);
            if (entry == null) {
                if (map.containsKey(A)) {
                    Integer val = map.get(A);
                    map.put(A, val+1);
                    color += 1;
                } else {
                    map.put(A, 1);
                    color += 1;
                }
            } else {
                map.remove(entry.getKey());
                if (entry.getValue() > 1) {
                    map.put(entry.getKey(), entry.getValue()-1);
                }
                if (map.containsKey(A)) {
                    Integer val = map.get(A);
                    map.put(A, val+1);
                } else {
                    map.put(A, 1);
                }
            }
        }
        out.println(color);
        out.flush();
    }
}

Compiler output:
Main.java:10: error: cannot find symbol
        FastScanner sc = new FastScanner();
        ^
  symbol:   class FastScanner
  location: class Main
Main.java:10: error: cannot find symbol
        FastScanner sc = new FastScanner();
                             ^
  symbol:   class FastScanner
  location: class Main
2 errors