Language: Java

#include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <list>
#include <map>
#include <set>
#include <string>
#include <cstring>
#include <sstream>
#include <cmath>
#include <functional>
#include <fstream>
#include <cstdlib>
typedef long long ll;
const ll MOD = 1e9+7;


#define REP(i, N) for (ll i = 0; i < (N); i++)
#define REPP(i, a, b) for (ll i = (a); i < (b); i++)
#define ALL(v) (v).begin(), (v).end()
#define RALL(v) (v).rbegin(), (v).rend()
#define VSORT(c) sort((c).begin(),(c).end())
#define SZ(x) ((ll)(x).size())
//vvintを作る　マクロで　 #define vvint(N,M) vector<vector<ll>>

using namespace std;
bool cmp(pair<int,int> a , pair<int,int> b){
    if(a.first == b.first){
        return a.second > b.second;
    }
    return a.first < b.first;
}


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

    int n,m;
    cin >> n >> m;
    vector<pair<int,int> > o;
    for(ll i = 0; i < m;i++){
        int a,b;
        cin >> a >> b;
        o.push_back(make_pair(a,b));
    }
    ll ans = 1;
    sort(ALL(o),cmp);
    int r = o[0].second;
    for(ll i = 0; i < m;i++){
        if(r <= o[i].first){
            ans++;
            r = o[i].second;
        }else{
            r = min(r,o[i].second);
        }
    }
    cout << ans << endl;

    return 0;
}

Compiler output:
Main.java:1: error: illegal character: '#'
#include <iostream>
^
Main.java:2: error: illegal character: '#'
#include <cstdio>
^
Main.java:3: error: illegal character: '#'
#include <algorithm>
^
Main.java:4: error: illegal character: '#'
#include <vector>
^
Main.java:5: error: illegal character: '#'
#include <stack>
^
Main.java:6: error: illegal character: '#'
#include <queue>
^
Main.java:7: error: illegal character: '#'
#include <list>
^
Main.java:8: error: illegal character: '#'
#include <map>
^
Main.java:9: error: illegal character: '#'
#include <set>
^
Main.java:10: error: illegal character: '#'
#include <string>
^
Main.java:11: error: illegal character: '#'
#include <cstring>
^
Main.java:12: error: illegal character: '#'
#include <sstream>
^
Main.java:13: error: illegal character: '#'
#include <cmath>
^
Main.java:14: error: illegal character: '#'
#include <functional>
^
Main.java:15: error: illegal character: '#'
#include <fstream>
^
Main.java:16: error: illegal character: '#'
#include <cstdlib>
^
Main.java:18: error: class, interface, enum, or record expected
const ll MOD = 1e9+7;
^
Main.java:21: error: illegal character: '#'
#define REP(i, N) for (ll i = 0; i < (N); i++)
^
Main.java:21: error: class, interface, enum, or record expected
#define REP(i, N) for (ll i = 0; i < (N); i++)
        ^
Main.java:21: error: class, interface, enum, or record expected
#define REP(i, N) for (ll i = 0; i < (N); i++)
                                 ^
Main.java:21: error: class, interface, enum, or record expected
#define REP(i, N) for (ll i = 0; i < (N); i++)
                                          ^
Main.java:22: error: illegal character: '#'
#define REPP(i, a, b) for (ll i = (a); i < (b); i++)
^
Main.java:22: error: class, interface, enum, or record expected
#define REPP(i, a, b) for (ll i = (a); i < (b); i++)
                                       ^
Main.java:22: error: class, interface, enum, or record expected
#define REPP(i, a, b) for (ll i = (a); i < (b); i++)
                                                ^
Main.java:23: error: illegal character: '#'
#define ALL(v) (v).begin(), (v).end()
^
Main.java:24: error: illegal character: '#'
#define RALL(v) (v).rbegin(), (v).rend()
^
Main.java:25: error: illegal character: '#'
#define VSORT(c) sort((c).begin(),(c).end())
^
Main.java:26: error: illegal character: '#'
#define SZ(x) ((ll)(x).size())
^
Main.java:30: error: unnamed classes are a preview feature and are disabled by default.
bool cmp(pair<int,int> a , pair<int,int> b){
^
  (use --enable-preview to enable unnamed classes)
Main.java:41: error: not a statement
    ios::sync_with_stdio(false);
    ^
Main.java:44: error: not a statement
    cin >> n >> m;
             ^
Main.java:48: error: not a statement
        cin >> a >> b;
                 ^
Main.java:62: error: not a statement
    cout << ans << endl;
                ^
Main.java:41: error: ';' expected
    ios::sync_with_stdio(false);
                        ^
34 errors